I created a workflow to take PDFs via Form Trigger, pass it to an HTTP that would use my locally hosted Sterling-PDF instance to crop, and then rotate the PDF to my specs, and finally upload the cropped and rotated PDFs to Dropbox. It worked great, I tested it a bunch - worked great - and then it just stopped working. It is broken specifically at the HTTP node. Neither of them work. I rolled up a new n8n instance on another local machine and it works like I had tested it earlier - both HTTP node accept the binary/PDF and change and then pass it through to the next node.
Here are the errors I get from the HTTP nodes:
Outputs
From HTTP Request:
As far as I can tell, the params are identical. I’m using Portainer to manage my docker containers, and went so far as to copy and paste the .env parameters directly. Same with volumes, etc.
As far as which node is triggering the error, I’ve tried patching the form to the second node, and it still creates the same error - so both nodes get the error.
Another hypothesis, is if this could be related to an issue/error returned from the server https://pdf.dogiakos.com/api/v1/general/crop . I am basing this by looking at the error stack you shared.
Yes, the workflow is activated while I’ve been troubleshooting
The machine is not my PC, but it is a computer at my house - a little home server running Docker on Debian, exposed to the internet with Nginx Proxy Manager - it was while it was working to. I’ve also tested via the server’s local IP address
It appears to be all/any PDFs
I’ve stopped the container, restarted, rolled the container back the version to when I successfully used the workflow, and now it’s back to the latest version - all with the same error.
Here’s the docker logs from when I test the workflow:
2024-09-10T02:33:41.453315979Z NodeApiError: Cannot read properties of null (reading 'name')
2024-09-10T02:33:41.453348179Z TypeError: Cannot read properties of null (reading 'name')
2024-09-10T02:34:31.545644656Z NodeApiError: Cannot read properties of null (reading 'name')
2024-09-10T02:34:31.545684311Z TypeError: Cannot read properties of null (reading 'name')
2024-09-10T02:42:26.444550047Z NodeApiError: Cannot read properties of null (reading 'name')
2024-09-10T02:42:26.444582434Z TypeError: Cannot read properties of null (reading 'name')
And when I run the work flow from the Production Form Trigger:
2024-09-10T18:19:51.695288327Z NodeApiError: Cannot read properties of null (reading 'name')
2024-09-10T18:19:51.695367994Z TypeError: Cannot read properties of null (reading 'name')
2024-09-10T18:23:18.834745347Z NodeApiError: Cannot read properties of null (reading 'name')
2024-09-10T18:23:18.834781229Z TypeError: Cannot read properties of null (reading 'name')
I can use the API successfully when testing it via the documentation and the exact same parameters passed through. And again, the nodes don’t throw any errors and work as expected on the other local machine with a new, but otherwise parallel instance of n8n.
I noticed at the bottom of the node parameters that the raw requests can be viewed in the browser’s developer console, so here’s that too if it helps: Pastebin
As noted in my immediate previous response the API appears to be functional based on testing via the docs and that the workflow/nodes work on the other machine, but if you have recommendations to test the API in other ways I am open to trying that!
I toggled the “Always Show Output” toggle, but it didn’t seem to give any different data than when it is turned off, unfortunately.
Looking at the logs beyond the workflow responses I noticed a couple lines that struck me as odd:
2024-09-09T23:50:03.810897792Z User settings loaded from: /home/node/.n8n/config
2024-09-09T23:50:05.474863100Z Initializing n8n process
2024-09-09T23:50:06.891643113Z ♥
2024-09-09T23:50:06.930729229Z Server path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + ipc.config.id /tmp/app.bot
2024-09-09T23:50:06.935787039Z starting server on /tmp/app.bot
2024-09-09T23:50:06.935940804Z starting TLS server false
2024-09-09T23:50:06.936556335Z starting server as Unix || Windows Socket
2024-09-09T23:50:06.939997921Z ipc bot server started
2024-09-09T23:50:08.242907499Z n8n ready on 0.0.0.0, port 5678
2024-09-09T23:50:09.975227565Z Version: 1.57.0
2024-09-09T23:50:10.800184225Z Editor is now accessible via:
2024-09-09T23:50:10.800188031Z http://localhost:5678/
2024-09-10T02:29:20.567034545Z Failed to renew license: renewal failed because current cert is not initialized
Particularly the Server path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + ipc.config.id /tmp/app.bot and Failed to renew license: renewal failed because current cert is not initialized
I haven’t really noticed them before (but they could have been there and I just didn’t notice them since I was looking for the logs of the workflow error). Could either of them be giving me trouble?
This is a trick issue to narrow down and may be a challenging one.
When I look at your raw request from workflow output - Pastebin.com and then I correlate it with the error Cannot read properties of null (reading ‘name’), it makes me think that the issue comes from the snippet of:
My first question is: can you get a similar snippet from a WORKING test and see what is shown in there? Does the null appears? If it does not, then what would cause it to appear? And being it legitimate, why we are getting into the error scenario? Maybe it should be considered when it is not.
As this is a Multipart form data, I am wondering if the null can be related with when a part of the form got to an end? I don’t know the specification in deep to tell for sure.
If we could figure out a way to reproduce this at will then the n8n team may be able to check it further.
I can’t narrow down the root cause of the issue, but I hope we can discuss towards it.
@ Flavio_Orfano
Thanks for continuing to troubleshoot this issue with me.
Here’s the console data from successfully executing the nodes on the other machine:
Cookie “__tld__” has been rejected for invalid domain. 2 192.168.1.51:5678
Cookie warnings 4
Cookie “__tld__” has been rejected for invalid domain. 2 192.168.1.51:5678
Cookie “dmn_chk_0191e219-7ae1-7d22-87ec-1a25db32835d” has been rejected for invalid domain. 3 192.168.1.51:5678
Content-Security-Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.
Partitioned cookie or storage access was provided to “https://n8n.io/self-install/?instanceId=21254deb4cc5024f58b6837fe40b21b3d6239f28c1009dfaaaf557e41b40a95a&userId=8a681ed5-f9b9-4ec3-9d9a-4e63bacaa6d1” because it is loaded in the third-party context and dynamic state partitioning is enabled.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015. (Reason: CORS request did not succeed). Status code: (null).
None of the “sha512” hashes in the integrity attribute match the content of the subresource. The computed hash is “z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==”. self-install
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015. (Reason: CORS request did not succeed). Status code: (null).
None of the “sha512” hashes in the integrity attribute match the content of the subresource. The computed hash is “z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==”. self-install
[Node: "Crop PDF using Stirling-PDF API"]
Object { headers: {…}, method: "POST", uri: "https://pdf.dogiakos.com/api/v1/general/crop", gzip: true, rejectUnauthorized: true, followRedirect: true, resolveWithFullResponse: true, followAllRedirects: true, timeout: 300000, formData: {…}, … }
usePushConnection-DmqdJ4p5.js:134:15
[Node: "Rotate Cropped PDF 90 Degrees"]
Object { headers: {…}, method: "POST", uri: "https://pdf.dogiakos.com/api/v1/general/rotate-pdf", gzip: true, rejectUnauthorized: true, followRedirect: true, resolveWithFullResponse: true, followAllRedirects: true, timeout: 300000, formData: {…}, … }
usePushConnection-DmqdJ4p5.js:134:15