Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 422 loading a pdf to be signed #4483

Open
ktrls opened this issue Jan 27, 2025 · 11 comments
Open

Error 422 loading a pdf to be signed #4483

ktrls opened this issue Jan 27, 2025 · 11 comments

Comments

@ktrls
Copy link

ktrls commented Jan 27, 2025

Hi, after the resolution of the issue #4455 I continued to test the libresign.
I'm able to assign a signer and draw a signing area. The signer receive the mail but when I click on the link and after the login I have a NO FILE FOUND error page.

Then I click on libresign icon and I view in the list of the document, the pdf to be signed.
I try to sign it but I wait forever.
So I try to sign with the browser console opened and this is the result:

Content-Security-Policy: Le impostazioni della pagina hanno bloccato l’esecuzione di un worker script (worker-src) da https://myserver/nextcloud/apps/libresign/js/pdf.worker.min.mjs in quanto viola la seguente direttiva: “script-src 'nonce-Ckc6FXiuc6w2LLChmWUBSfDqjfn2YkcKvivdHsVU/9Q=' 'unsafe-eval'”

and as a last error

Object { message: 'Unexpected server response (422) while retrieving PDF "https://myserver/nextcloud/apps/libresign/pdf/0009430e-bda9-48ee-ba43-5abad79a097a".', name: "UnexpectedResponseException", status: 422, stack: "29082/r/4491/ue<@https:///nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:1770445\n4491@https:///nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:1770473\nn@https:///nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:2146048\n29082/r/<@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:2171260\n29082/r/<@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:2590086\nr@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:2590091\n29082@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:2590105\no@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:4960483\n65111@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:3668248\no@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:4960483\n@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:4980008\n@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:5045898\n@https://myserver/nextcloud/apps/libresign/js/libresign-main.js?v=49e87620-0:2:5045902\n" }

@vitormattos
Copy link
Member

vitormattos commented Jan 30, 2025

The signer receive the mail but when I click on the link and after the login I have a NO FILE FOUND error page.

Could you provide a screenshot of this page took at the newest version?

I made changes at this page at newest version to display more details about what's happening. At the previous version the reason to display this page wasn't displayed.

@vitormattos
Copy link
Member

"https://myserver/nextcloud/apps/libresign/pdf/0009430e-bda9-48ee-ba43-5abad79a097a".', name: "UnexpectedResponseException", status: 422

This is an issue from api side.

Could you provide the body of this request also at developer tools of your browser?

And also would be good to check if have any entry at nextcloud.log file when this request is made.

@ktrls
Copy link
Author

ktrls commented Jan 30, 2025

In the error nextcloud logs I read

_2025/01/27 17:06:35 [error] 308778#308778: *7 FastCGI sent in stderr: "PHP message: PHP Fatal error: Trait "OCA\Libresign\Handler\CertificateEngine\OrderCertificatesTrait" not found in /var/www/nextcloud/apps/libresign/lib/Handler/CertificateEngine/AEngineHandler.php on line 49" while reading response header from upstream, client: 82.192.135.167, server: , request: "GET /nextcloud/apps/files/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php-fpm.sock:", host: "vmi1532086.contaboserver.net"

and nothing else.

In the access nextcloud logs I read

82.192.135.167 - - [30/Jan/2025:16:40:34 +0100] "GET /nextcloud/apps/libresign/pdf/0009430e-bda9-48ee-ba43-5abad79a097a HTTP/1.1" 422 42 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
82.192.135.167 - - [30/Jan/2025:16:40:36 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
82.192.135.167 - - [30/Jan/2025:16:40:44 +0100] "GET /nextcloud/ocs/v2.php/apps/libresign/api/v1/file/list?force_fetch=true&sortBy=name&sortDirection=asc HTTP/1.1" 200 773 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
82.192.135.167 - - [30/Jan/2025:16:40:47 +0100] "GET /nextcloud/apps/libresign/pdf/0009430e-bda9-48ee-ba43-5abad79a097a HTTP/1.1" 422 42 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
82.192.135.167 - - [30/Jan/2025:16:41:06 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
82.192.135.167 - - [30/Jan/2025:16:41:37 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
82.192.135.167 - - [30/Jan/2025:16:42:07 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"

If I open the browser's developer tools I see this

Image

So the response says: expired link

I don't know if is userful but in my server I use php 8.3
Let mi know if you need something else

@ktrls
Copy link
Author

ktrls commented Jan 30, 2025

These are the screenshot:

selecting the file to sign

Image

after click on the "Firma" (Sign) button

Image

@vitormattos
Copy link
Member

Your issue is this:

OCA\Libresign\Handler\CertificateEngine\OrderCertificatesTrait" not found in /var/www/nextcloud/apps/libresign/lib/Handler/CertificateEngine/AEngineHandler.php on line 49

Are you with the newest release of LibreSign?

This error is very strange because have integration and unit tests covering this code.

@ktrls
Copy link
Author

ktrls commented Jan 31, 2025

My versoni is 10.6.1

I try to load a video

firefox_qmlzRIPEFu.mp4

@vitormattos
Copy link
Member

What's the body that stay at body of this endpoint with status code 422?

@ktrls
Copy link
Author

ktrls commented Jan 31, 2025

is this the answer of your question?

Object { message: 'Unexpected server response (422) while retrieving PDF "https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/pdf/0009430e-bda9-48ee-ba43-5abad79a097a".', name: "UnexpectedResponseException", status: 422, stack: "29082/r/4491/ue<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770445\n4491@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770473\nn@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2146048\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2171260\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590086\nr@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590091\n29082@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590105\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n65111@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:3669560\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4983903\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050446\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050450\n" }

message: 'Unexpected server response (422) while retrieving PDF "https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/pdf/0009430e-bda9-48ee-ba43-5abad79a097a".'

name: "UnexpectedResponseException"

stack: "29082/r/4491/ue<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770445\n4491@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770473\nn@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2146048\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2171260\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590086\nr@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590091\n29082@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590105\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n65111@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:3669560\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4983903\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050446\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050450\n"

status: 422

: Object { stack: "29082/r/4491/ue<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770445\n4491@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770473\nn@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2146048\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2171260\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590086\nr@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590091\n29082@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590105\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n65111@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:3669560\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4983903\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050446\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050450\n", … }
​​
constructor: class fe { constructor(e, t) }
​​
stack: "29082/r/4491/ue<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770445\n4491@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770473\nn@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2146048\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2171260\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590086\nr@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590091\n29082@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590105\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n65111@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:3669560\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4983903\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050446\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050450\n"
​​
: Error:
​​​
columnNumber: 1770445
​​​
fileName: "https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0"
​​​
lineNumber: 2
​​​
stack: "29082/r/4491/ue<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770445\n4491@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:1770473\nn@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2146048\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2171260\n29082/r/<@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590086\nr@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590091\n29082@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:2590105\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n65111@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:3669560\no@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4964299\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:4983903\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050446\n@https://vmi1532086.contaboserver.net/nextcloud/apps/libresign/js/libresign-main.js?v=63f6f774-0:2:5050450\n"
​​​
: Error.prototype { stack: "", … }
​​​​
constructor: function Error()
​​​​
message: ""
​​​​
name: "Error"
​​​​
stack: ""
​​​​
toString: function toString()

@ktrls
Copy link
Author

ktrls commented Jan 31, 2025

Maybe there is some permission rule to make on the file system?

I check again the configuration of libresign after the update and I found some errors so I did the occ instruction to repair and now all is green.

If it helps you here is the header's request

{
	"Header richiesta (860 B)": {
		"headers": [
			{
				"name": "Accept",
				"value": "*/*"
			},
			{
				"name": "Accept-Encoding",
				"value": "gzip, deflate, br, zstd"
			},
			{
				"name": "Accept-Language",
				"value": "it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3"
			},
			{
				"name": "Connection",
				"value": "keep-alive"
			},
			{
				"name": "Cookie",
				"value": "oc_sessionPassphrase=71xhfdPY0%2FUGjd8WKFQaJPjBZmrV69eQwaGnmZDSwxlMZPMuQ0VCJsia%2BzWEKwdr0y4lF6CGi2zgiKWhOlBPCudDvgjULIdsSCP0bIQCUqkFlgKa5MkRpBpo3pLvmH3m; nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; occ7wocymcpo=04a9o0fu560dvajp8s3hk7kio5; nc_username=salvo; nc_token=9ccfQNkeSE9%2FfwSxTa3zRJTnYGKSnR%2F%2B; nc_session_id=04a9o0fu560dvajp8s3hk7kio5"
			},
			{
				"name": "DNT",
				"value": "1"
			},
			{
				"name": "Host",
				"value": "vmi1532086.contaboserver.net"
			},
			{
				"name": "Priority",
				"value": "u=0"
			},
			{
				"name": "Sec-Fetch-Dest",
				"value": "empty"
			},
			{
				"name": "Sec-Fetch-Mode",
				"value": "cors"
			},
			{
				"name": "Sec-Fetch-Site",
				"value": "same-origin"
			},
			{
				"name": "Sec-GPC",
				"value": "1"
			},
			{
				"name": "User-Agent",
				"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
			},
			{
				"name": "x-requested-with",
				"value": "XMLHttpRequest"
			}
		]
	}
}

and the header's response

{
	"Header risposta (777 B)": {
		"headers": [
			{
				"name": "Cache-Control",
				"value": "no-cache, no-store, must-revalidate"
			},
			{
				"name": "Connection",
				"value": "keep-alive"
			},
			{
				"name": "Content-Length",
				"value": "42"
			},
			{
				"name": "Content-Security-Policy",
				"value": "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'"
			},
			{
				"name": "Content-Type",
				"value": "application/json; charset=utf-8"
			},
			{
				"name": "Date",
				"value": "Fri, 31 Jan 2025 16:19:56 GMT"
			},
			{
				"name": "Feature-Policy",
				"value": "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'"
			},
			{
				"name": "Referrer-Policy",
				"value": "no-referrer"
			},
			{
				"name": "Server",
				"value": "nginx/1.18.0 (Ubuntu)"
			},
			{
				"name": "Strict-Transport-Security",
				"value": "max-age=63072000"
			},
			{
				"name": "X-Content-Type-Options",
				"value": "nosniff"
			},
			{
				"name": "X-Download-Options",
				"value": "noopen"
			},
			{
				"name": "X-Frame-Options",
				"value": "SAMEORIGIN"
			},
			{
				"name": "X-Permitted-Cross-Domain-Policies",
				"value": "none"
			},
			{
				"name": "X-Request-Id",
				"value": "7NgShzdlelZD4LMGbDeP"
			},
			{
				"name": "X-Robots-Tag",
				"value": "noindex, nofollow"
			},
			{
				"name": "X-XSS-Protection",
				"value": "1; mode=block"
			}
		]
	}
}

@vitormattos
Copy link
Member

vitormattos commented Jan 31, 2025

I check again the configuration of libresign after the update and I found some errors so I did the occ instruction to repair and now all is green.

I made a update of Java version:

After every dependency version upgrade, is necessary to download the newest version of outdated dependency.

@vitormattos
Copy link
Member

The issue is the error that you found at your log file:

OCA\Libresign\Handler\CertificateEngine\OrderCertificatesTrait" not found in /var/www/nextcloud/apps/libresign/lib/Handler/CertificateEngine/AEngineHandler.php on line 49

But the problem is that I can't reproduce this and have a lot of tests covering this row at CI flow every when a PR is made and before all releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants