Error while executing pdf-utils operations. Page crashed!



  • Hi, I am getting the error below. I'm using jsreport v3.5.0 and node v16.15.0

    Error while executing pdf-utils operations. Page crashed!
    Error: Error while executing pdf-utils operations. Page crashed!
        at module.exports (/Users/user/Documents/workspace/jsreporting/node_modules/@jsreport/jsreport-core/lib/shared/createError.js:10:13)
        at WorkerReporter.createError (/Users/user/Documents/workspace/jsreporting/node_modules/@jsreport/jsreport-core/lib/shared/reporter.js:47:12)
        at AsyncFunction.<anonymous> (/Users/user/Documents/workspace/jsreporting/node_modules/@jsreport/jsreport-pdf-utils/lib/worker.js:191:22)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async ListenerCollection.fire (/Users/user/Documents/workspace/jsreporting/node_modules/@jsreport/jsreport-core/lib/shared/listenerCollection.js:157:21)
        at async afterRender (/Users/user/Documents/workspace/jsreporting/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:103:5)
        at async WorkerReporter._render (/Users/user/Documents/workspace/jsreporting/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:148:7)
        at async /Users/user/Documents/workspace/jsreporting/node_modules/@jsreport/jsreport-core/lib/worker/reporter.js:177:19
        at async Domain.<anonymous> (/Users/user/Documents/workspace/jsreporting/node_modules/@jsreport/advanced-workers/lib/workerHandler.js:141:19)
    caused by: Error: Page crashed!
        at Page._onTargetCrashed (/Users/user/Documents/workspace/jsreporting/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:325:28)
        at /Users/user/Documents/workspace/jsreporting/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:155:57
        at /Users/user/Documents/workspace/jsreporting/node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:62
        at Array.map (<anonymous>)
        at Object.emit (/Users/user/Documents/workspace/jsreporting/node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:43)
        at CDPSession.emit (/Users/user/Documents/workspace/jsreporting/node_modules/puppeteer/lib/cjs/puppeteer/common/EventEmitter.js:72:22)
        at CDPSession._onMessage (/Users/user/Documents/workspace/jsreporting/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:249:18)
        at Connection._onMessage (/Users/user/Documents/workspace/jsreporting/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:117:25)
        at WebSocket.<anonymous> (/Users/user/Documents/workspace/jsreporting/node_modules/puppeteer/lib/cjs/puppeteer/node/NodeWebSocketTransport.js:13:32)
        at WebSocket.onMessage (/Users/user/Documents/workspace/jsreporting/node_modules/ws/lib/event-target.js:199:18)
    

    I am currently testing v3.5. We use 2.11 in production and are looking into upgrading soon but I am running into this issue with large reports or those that take long to generate.

    Anyone know what the issue could be? Any help is appreciated.



  • This error says that chrome badly crashed for unknown reasons. Unfortunately, you won't get more information and there is nothing jsreport can do for you.

    jsreport v3 is using updated chrome and that is likely the main reason you see this regression issue.

    This often happens when there are not enough memory resources, but I see you run on local so that is likely not the case.

    Are you aware of this problem with images?
    https://jsreport.net/learn/chrome-pdf#images-increasing-pdf-size



  • @jan_blaha Thank you for the prompt reply. I forgot to mention that these same reports run perfectly fine in 2.11.

    I have been successful with running some similar reports that are around 5 mb in size, but that's the max. Anything larger than that fails.

    I think that it is a problem with images because these certain reports contain large jpegs of maps. Resizing is not really an option for us since these maps are very detailed by design. Would there be an alternative solution or any more insight into what changed with v3.5 and the updated chrome?



  • You can see the chrome number in the output logs
    0_1654272649791_upload-0d131424-23bb-4ac6-9f0f-83b9d0256558

    We were aware of some performance changes in the new chrome, but there were no other options than to update because old chrome has security holes and we need to update it regularly.



  • @jan_blaha I have tried again on jsreport 3.7.1 but still facing the same issues. I've also tried modifying the config for chrome-pdf and its launchOptions but haven't been successful. Is there anything else you can suggest?



  • Did you try to use a more powerful HW? Don't you have some resource limits applied with kubernetes/docker... ?

    If its possible, you can email me the workspace with the replicated crashing scenario and I can take a look. However, Chrome is black-box for us. We just typically try to remove styles and parts of the template to identify the minimal part causing the chrome crash and then think if it can be replaced with something else without big impact on the output.



  • @jan_blaha I'm running this locally before deploying to prod so I tried to manually allocate more memory (8GB) to the node process running jsreport but that didn't work. I haven't been able to fully resolve the issue but I did find something interesting.

    I tried providing our own version of chromium by setting "executablePath": "chrome-mac-${#}/Chromium.app/Contents/MacOS/Chromium". I tried 4 versions of chromium: r706915 (jsreport 2.11.0 - puppeteer 2.0.0), r950341 (js-report 3.7.1 - puppeteer 13.1.2), r991974 (puppeteer 14.0.0) and r1036695 (puppeteer 16.1.1). Running the reports worked with all 4 except r950341.

    Do you think upgrading the chromium version would fix this issue? If so, is there a plan to upgrade the puppeteer version jsreport is using in the near future? Or if there is an alternative way we can do so on our end?



  • Do you think upgrading the chromium version would fix this issue?

    It can be. The chrome performance fluctuates with different versions.
    In our experience, it is getting even a little bit worse with new chrome versions.

    If so, is there a plan to upgrade the puppeteer version jsreport is using in the near future?

    Yes, we regularly update chrome to resolve security issues. But you can use the executablePath config to use the version you want.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.