chrome-pdf timing out compared to Phantom-pdf



  • Hello!

    We've been migrating out JSreport v1.10 installation to version 2.3. We've switched to using chrome-pdf, and have had to make some small changes to formatting to make chrome-pdf play nice with the reports.

    While we've been migrating, we noticed that our largest report is beginning to time out on chrome-pdf. It has never done this on phantom-pdf. We were hoping someone could shed some light onto why it might be timing out.

    Here's a copy of the logs. I've replaced the input data with "..." because there's a lot of data.

    Let me know what information you might need to help troubleshoot this. Thanks!

    2019-03-20T17:15:54.994Z - error: Error during processing request at http://localhost:5488/api/report
    2019-03-20T17:19:01.638Z - info: Starting rendering request 31 (user: null)
    2019-03-20T17:19:01.643Z - info: Rendering template { name: LossDetailReport, recipe: chrome-pdf, engine: handlebars, preview: false }
    2019-03-20T17:19:01.645Z - debug: Inline data specified.
    2019-03-20T17:19:01.646Z - debug: Resources not defined for this template.
    2019-03-20T17:19:01.647Z - debug: Base url not specified, skipping its injection.
    2019-03-20T17:19:01.655Z - debug: Replaced assets ["Common_Styles.css","Report styles.css","EnterpriseLogo.png"]
    2019-03-20T17:19:01.657Z - debug: Rendering engine handlebars
    2019-03-20T17:19:02.332Z - debug: Taking compiled template from engine cache
    2019-03-20T17:19:02.569Z - debug: Executing recipe chrome-pdf
    2019-03-20T17:19:02.712Z - debug: Starting child request to render pdf header
    2019-03-20T17:19:02.714Z - info: Starting rendering request 32 (user: null)
    2019-03-20T17:19:02.716Z - info: Rendering template { name: LossDetailReport, recipe: html, engine: handlebars, preview: false }
    2019-03-20T17:19:02.717Z - debug: Inline data specified.
    2019-03-20T17:19:02.718Z - debug: Resources not defined for this template.
    2019-03-20T17:19:02.720Z - debug: Base url not specified, skipping its injection.
    2019-03-20T17:19:02.757Z - debug: Replaced assets ["header.html"]
    2019-03-20T17:19:02.761Z - debug: Replaced assets ["EnterpriseLogo.png"]
    2019-03-20T17:19:02.762Z - debug: Rendering engine handlebars
    2019-03-20T17:19:02.949Z - debug: Taking compiled template from engine cache
    2019-03-20T17:19:02.952Z - debug: Executing recipe html
    2019-03-20T17:19:02.953Z - debug: Skipping storing report.
    2019-03-20T17:19:02.954Z - info: Rendering request 32 finished in 240 ms
    2019-03-20T17:19:02.955Z - debug: Starting child request to render pdf footer
    2019-03-20T17:19:02.955Z - info: Starting rendering request 33 (user: null)
    2019-03-20T17:19:02.957Z - info: Rendering template { name: LossDetailReport, recipe: html, engine: handlebars, preview: false }
    2019-03-20T17:19:02.958Z - debug: Inline data specified.
    2019-03-20T17:19:02.958Z - debug: Resources not defined for this template.
    2019-03-20T17:19:02.961Z - debug: Base url not specified, skipping its injection.
    2019-03-20T17:19:02.985Z - debug: Replaced assets ["footer.html"]
    2019-03-20T17:19:02.986Z - debug: Rendering engine handlebars
    2019-03-20T17:19:03.159Z - debug: Taking compiled template from engine cache
    2019-03-20T17:19:03.164Z - debug: Executing recipe html
    2019-03-20T17:19:03.165Z - debug: Skipping storing report.
    2019-03-20T17:19:03.166Z - info: Rendering request 33 finished in 211 ms
    2019-03-20T17:19:03.940Z - debug: Converting with chrome HeadlessChrome/73.0.3679.0 using dedicated-process strategy
    2019-03-20T17:19:11.179Z - debug: Running chrome with params {...}
    2019-03-20T17:19:44.398Z - error: Error when processing render request Timeout Error: pdf generation not completed after 40000ms Error: Timeout Error: pdf generation not completed after 40000ms
    at Timeout.setTimeout (D:\jsreport2\node_modules\jsreport-chrome-pdf\lib\conversion.js:187:19)
    at listOnTimeout (timers.js:324:15)
    at processTimers (timers.js:268:5)
    2019-03-20T17:19:44.403Z - error: Error during processing request at http://localhost:5488/api/report


  • administrators

    hi! hmm at first glance i'm not sure what can be the problem, maybe there is some problematic html in your code that causes chrome to perform badly. you can share with us your example (either by sharing a zip file of your entities or by creating your example in the online playground and then share the link here) so we can take a look if there is something you can do to improve your performance with chrome.



  • Thanks for the response!

    That sounds helpful. Generally though, we'd like to avoid sending out our reports publicly on the forum (we have policy against it). I've spoken with Jan a number of times off of the forum; should I email the file and context to him? Or may I send it to you?

    Thanks!
    Tyler



  • You can send the email to me, but the first ...

    Please try to cut down the report to the smallest part which is causing the timeout.
    Essentially we would do the same anyway - try to remove styles, remove some headers, remove boilparade around...
    Hopefully, you would be able to limit the report to some smaller codebase we can start reasoning about



  • Thanks Jan!

    I've emailed over the template as requested.

    Thanks!
    Tyler


Log in to reply
 

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