Timeout Issue When Generating Large PDFs (On-Premise, Enterprise License)
-
Hello everyone,
We are experiencing a timeout issue when trying to generate a multi-page document using jsreport. No matter what configuration we set, the process fails after 30 seconds with a timeout error.
From the logs, it appears to be a timeout related to the template rendering. Here is a screenshot of the error message:
We are running an on-premise instance with an enterprise license using the following setup:
- Image: jsreport/jsreport:4.0.0-full
- Configuration:
{ "trustUserCode": true, "allowLocalFilesAccess": true, "reportTimeout": 180000, "enableRequestReportTimeout": false, "store": { "provider": "fs" }, "extensions": { "chrome-pdf": { "timeout": 180000 }, "scripts": { "timeout": 180000 }, "fs-store": { "syncModifications": { "updateStudio": true } } }, "chrome": { "timeout": 180000 }, "workers": { "numberOfWorkers": 3 } }
Despite setting the timeouts to 180 seconds, the process still fails at the 30-second mark.
Has anyone encountered a similar issue? Could there be additional settings affecting the template execution timeout?
Thanks in advance for any help!
-
It could be a problem with your client call. How do you make the API request? Don't you need to add a timeout config there?
-
Hi! Thanks for getting back to me!
I've checked multiple times, and we're using Axios with the default timeout set to 0, so there’s no timeout configured on our end. However, it looks like reportTimeout doesn’t seem to affect chrome-pdf's timeout.
Do you have any suggestions on how to fix this? I'd really appreciate any insights!
-
What if you run the same request in the browser/studio? Does that timeout after 30s as well?
Don't you have on the way to jsreport some kind of proxy/load balancer/web server that could have the 30s timeout ?
Can you try the same with the latest jsreport 4.7.0?
-
Hi! sorry for the delay in replying.
Unfortunately we are still stuck with this issue...
What if you run the same request in the browser/studio? Does that timeout after 30s as well?
We tried and we have the same error here too; after 30 seconds the pdf generation breaks.
Don't you have on the way to jsreport some kind of proxy/load balancer/web server that could have the 30s timeout ?
Nope. We double checked and there is nothing that times out to 30s.
Can you try the same with the latest jsreport 4.7.0?
We tried with version 480 and the error remains the same.
-
Hm, I still think there must be some kind of network infrastructure that interrupts the request when it doesn't send a response in 30s....
What if you try a template that waits 40s, like a template with this in the helpers
await new Promise((resolve) => setTimeout(resolve, 40000)
Does that fail on the same error?
If yes, then can you try to install jsreport on your local and try to render it locally, does that fail as well?