Puppeteer error after upgrading to 3.13.0
-
after upgrading our docker Jsreport deployment to 3.13.0 release one of our report based on chrome-pdf recipe fails with the following error:
Report "test_report" render failed. Protocol error (Page.printToPDF): Printing failed ProtocolError: Protocol error (Page.printToPDF): Printing failed at new Callback (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:62:35) at CallbackRegistry.create (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:108:26) at Connection._rawSend (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:224:26) at CDPSessionImpl.send (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:433:78) at CDPPage.createPDFStream (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js:738:88) at CDPPage.pdf (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js:771:37) at /app/node_modules/@jsreport/jsreport-chrome-pdf/lib/conversion.js:391:27 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /app/node_modules/@jsreport/jsreport-chrome-pdf/lib/conversion.js:432:22
the report is 33 pages long.
Unfortunately i cannot upload it to playground.
Another smaller report works correctly.
if i change the recipe to html it works so it seems a puppeteer problem.if i downgrade to 3.12.0 it works.
What i can do to debug the problem and solve the issue?
Thanks,
Luca
-
This is typically happening when the chrome reaches HW resources limits.
Don't you limit the container memory/cpu?Unfortunately, the chrome performance fluctuates between versions. You may need to provide it more resources in one version when the other works fine.
-
I've tried giving to docker 12 core and 12gb ram on mac and linux host
i have no restriction on the container.
From stats i see that it consumes around 4gb ram and 40% cpu.
it runs a bit more but then crash with the same error.info+0 Render request 1 queued for execution and waiting for available worker info +214 Starting rendering request 1 info +11 Rendering template { name: test_report, recipe: chrome-pdf, engine: handlebars, preview: true } debug +52 Adding sample data _gUwF-eBU debug +38 Base url not specified, skipping its injection. debug +8 Rendering engine handlebars debug +5984 Executing recipe chrome-pdf debug +706 Starting child request to render pdf footer info +1 Starting rendering (child) request info +0 Rendering anonymous template { recipe: html, engine: handlebars } debug +0 Inline data specified. debug +2 Base url not specified, skipping its injection. debug +1Rendering engine handlebars debug +45Executing recipe html debug+4Skipping storing report. info+2Rendering (child) request finished in 7083 ms debug+1480Converting with chrome HeadlessChrome/114.0.5735.133 using chrome-pool strategy debug+393Page request: GET (document) file:///tmp/jsreport/autocleanup/60e9b4cb-52c3-46c7-836e-6cf0eb6a7d77-chrome-pdf.html debug+34Page request: GET (stylesheet) http://localhost:5488/assets/content/common/assets/bootstrap.min.css debug+4Page request finished: GET (document) 200 file:///tmp/jsreport/autocleanup/60e9b4cb-52c3-46c7-836e-6cf0eb6a7d77-chrome-pdf.html debug+0Page request: GET (stylesheet) http://localhost:5488/assets/content/common/assets/deliverable.css debug+2Page request: GET (script) http://localhost:5488/assets/content/common/assets/plotly-2.16.1.min.js debug+45Page request finished: GET (stylesheet) 200 http://localhost:5488/assets/content/common/assets/deliverable.css debug+4Page request: GET (image) http://localhost:5488/assets/content/common/assets/horizontal.png debug+5Page request finished: GET (stylesheet) 200 http://localhost:5488/assets/content/common/assets/bootstrap.min.css debug+21Page request finished: GET (image) 200 http://localhost:5488/assets/content/common/assets/horizontal.png debug+150Page request finished: GET (script) 200 http://localhost:5488/assets/content/common/assets/plotly-2.16.1.min.js debug+262Page request finished: GET (image) 200 data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA= debug+1Page request: GET (image) data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA= debug+345Page request: GET (image) http://localhost:5488/assets/content/common/assets/report_cover.png debug+1Page request: GET (font) http://localhost:5488/assets/content/common/assets/TitilliumWeb-Regular.ttf debug+162Page request: GET (font) http://localhost:5488/assets/content/common/assets/TitilliumWeb-Regular.ttf debug+154Page request finished: GET (font) 200 http://localhost:5488/assets/content/common/assets/TitilliumWeb-Regular.ttf debug+164Page request finished: GET (image) 200 http://localhost:5488/assets/content/common/assets/report_cover.png debug+866Running chrome with params {"printBackground":true,"mediaType":"screen","marginTop":".25in","marginRight":".5in","marginBottom":".5in","marginLeft":".5in","displayHeaderFooter":true,"footerTemplate":"...","timeout":5992915,"margin":{"top":".25in","right":".5in","bottom":".5in","left":".5in"}} error+115885Error when processing render request 1 (because) protocol error (Page.printToPDF): Printing failed ProtocolError: Protocol error (Page.printToPDF): Printing failed at new Callback (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:62:35) at CallbackRegistry.create (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:108:26) at Connection._rawSend (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:224:26) at CDPSessionImpl.send (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:433:78) at CDPPage.createPDFStream (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js:738:88) at CDPPage.pdf (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js:771:37) at /app/node_modules/@jsreport/jsreport-chrome-pdf/lib/conversion.js:391:27 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /app/node_modules/@jsreport/jsreport-chrome-pdf/lib/conversion.js:432:22 error +8 Rendering request 1 finished with error in 127069 ms
-
Thank you for trying with more resources.
Unfortunately, I am not aware of any troubleshooting steps for this chrome crash provided by chrome or puppeteer .
You may need to remove some content to identify what exactly causing the chrome crash.
If you email me a working export, I will try it on my PC.
-
Searching around seems a chromium bug on chromium 114 solved on 116 :
https://github.com/puppeteer/puppeteer/issues/8070
-
Great, I am even subscribed to this github issue but missed the notification.
We will update chrome with the next release during the next few weeks.
Thank you for your search.