chrome pdf generation timed out
-
Hello,
Just installed the latest version of JSReport Server. When i start it from the command line using "jsreport start" everything works fine. However, when running from a service after running "jsreport win-install", none of the chrome-pdf or chrome-image recipes work. The error is:
*Report "test" render failed.
chrome pdf generation timed out
Error: chrome pdf generation timed out
at module.exports (C:\jsreport\node_modules@jsreport\jsreport-core\lib\shared\createError.js:10:13)
at WorkerReporter.createError (C:\jsreport\node_modules@jsreport\jsreport-core\lib\shared\reporter.js:53:12)
at Timeout._onTimeout (C:\jsreport\node_modules@jsreport\jsreport-chrome-pdf\lib\conversion.js:423:30)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)*I've copied the puppeteer folder to the appropriate user profile of the profile used to run the installation of jsreport.
-
Try adding the following config to the root
"chrome": { "launchOptions": { "args": ["--no-sandbox"] } }
The puppeteer has currently an open issue tracking this
https://github.com/puppeteer/puppeteer/issues/12857
-
Gaaaar, that fixed it. I've been trying to find a solution for a couple of days-worth of time for the past week, so thank you!
-
I have the same issue. The 'launchOptions' did not help in my case.
When using jsreport.exe version 18.15.0.0 as the report server, I get this error:
When using jsreport.exe version 16.12.0.0 my (very simple) report is generated as pdf just fine:
I'm using "@jsreport/nodejs-client": "^4.0.2" as the report client.
Please help/advise.
Thanks in advance.
-
I have the same problem as well
It breaks on large pdfs (100 pages plus), hasn't worked since version 4.2
Updating the timeout and adding --no-sandbox didn't fix it
I'm assuming the issue is either due ton the chrome update in 4.4 via puppeteer or the refactor in 4.3
However, 4.3 is broken (throws a js error) so it's hard to narrow down which one is the problem.
Unfortunately I can't provide any of the templates / custom code, but it would be great if there's another solution someone found to this.
-
I have now tried with the minimal possible example I could think of:
Any ideas why it is not working?
-
I've tried to download the latest jsreport binary from here
https://github.com/jsreport/jsreport/releases/tag/4.6.0I then extracted the
jsreport.exe
and placed in the same folder filejsreport.config.json
with content{ "chrome": { "launchOptions": { "args": ["--no-sandbox"] } } }
and
request.json
as you have it. The render command then works fine
jsreport.exe render --request=request.json --out=out.pdf
Without the config, it times out. I have win 11.
Perhaps try to delete folder
c:\Users\[your user]\AppData\Local\Temp\jsreport
and try again.
-
Thank Jan for your suggestions!
I have tried:
- run cmd as administrator
- run jsreport in c:\temp folder (where request.json is in same folder)
- deleting then jsreport temp folder under Users (and version 4.6 stuff is recreated when I run the command)
- having same content in request.json as you (and same command line parameters)
- runing in Windows 11
Still same problem😢
Any other suggestions?
Any help is very appreciated!
-
Please try also run the normal installation from npm https://jsreport.net/on-prem Does that work?
Also, try to run the following command. The path there is the chrome installation folder with the npm install
icacls %USERPROFILE%/.cache/puppeteer/chrome /grant *S-1-15-2-1:(OI)(CI)(RX)
-
Running the server as a on-prem installation works! The client can generate a report! 😊
Changing the grants of the chrome folder did not help:
Using jsreport binaries (jsreport.exe) is still not working in my setup.
-
Changing the grants of the chrome folder did not help:
Please try to change the
%USERPROFILE%/.cache/puppeteer/chrome
to the chrome directory extracted fromjsreport.exe
. Something like thisc:\Users\xxx\AppData\Local\Temp\jsreport\compile\jsreport-4.6.0-b51a1z0mo\chrome
-
Voilà ! It now works!
Must have been a granting issue for the folder!
Thanks a lot!
It also work without the "--no-sandbox" option