jsreport / jsreport-wkhtmltopdf

jsreport recipe for rendering pdf using wkhtmltopdf
http://jsreport.net
MIT License
8 stars 9 forks source link

Sporatic Issue Generating PDFs #10

Closed asaltiel72 closed 6 years ago

asaltiel72 commented 6 years ago

So I am having an issue generating PDFs from handlebars templates. This is being used on AWS and sometimes in very large volume. Recently I started getting the following error trace and cannot figure out what the true error is. I personally cannot reproduce the error, but it has begun to happen daily. Here is the trace:

ERROR: Error during rendering report: Command failed: /var/task/node_modules/wkhtmltopdf-installer/vendor/wkhtmltopdf --debug-javascript --page-size Letter --margin-bottom 15mm --margin-left 5mm --margin-right 5mm --margin-top 29mm --orientation Portrait --header-spacing 3 --header-html file:////tmp/jsreport-temp/617e1b90-f4d7-11e7-8021-af53ee976040header.html --footer-spacing 3 --footer-html file:////tmp/jsreport-temp/617e1b90-f4d7-11e7-8021-af53ee976040footer.html /tmp/jsreport-temp/617e1b90-f4d7-11e7-8021-af53ee976040.html /tmp/jsreport-temp/617e1b90-f4d7-11e7-8021-af53ee976040.pdf

Here are the fatal level log messages received:

Error Loading pages (1/6) [> ] 0% [======> ] 10% [===========================> ] 45% [============================> ] 48% [============================================================] 100% Counting pages (2/6)
[============================================================] Object 1 of 1 Resolving links (4/6)
[============================================================] Object 1 of 1 Loading headers and footers (5/6)
[> ] 1% [=> ] 2% [=> ] 3% [===> ] 5% [===> ] 6% [====> ] 7% [====> ] 8% [======> ] 10% [=========> ] 15% [============> ] 21% [===============> ] 26% [===================> ] 32% [======================> ] 37% [=========================> ] 43% [============================> ] 48% [=================================> ] 55% [====================================> ] 60% [=======================================> ] 66% [==========================================> ] 71% [==============================================> ] 77% [=================================================> ] 82% [====================================================> ] 88% [=======================================================> ] 93% [============================================================] 100% Printing pages (6/6)
[> ] Preparing [===============> ] Page 1 of 4 [==============================> ] Page 2 of 4 [=============================================> ] Page 3 of 4 [============================================================] Page 4 of 4 [============================================================] Page 5 of 4

Stack Trace: Loading pages (1/6) [> ] 0% [======> ] 10% [===========================> ] 45% [============================> ] 48% [============================================================] 100% Counting pages (2/6)
[============================================================] Object 1 of 1 Resolving links (4/6)
[============================================================] Object 1 of 1 Loading headers and footers (5/6)
[> ] 1% [=> ] 2% [=> ] 3% [===> ] 5% [===> ] 6% [====> ] 7% [====> ] 8% [======> ] 10% [=========> ] 15% [============> ] 21% [===============> ] 26% [===================> ] 32% [======================> ] 37% [=========================> ] 43% [============================> ] 48% [=================================> ] 55% [====================================> ] 60% [=======================================> ] 66% [==========================================> ] 71% [==============================================> ] 77% [=================================================> ] 82% [====================================================> ] 88% [=======================================================> ] 93% [============================================================] 100% Printing pages (6/6)
[> ] Preparing [===============> ] Page 1 of 4 [==============================> ] Page 2 of 4 [=============================================> ] Page 3 of 4 [============================================================] Page 4 of 4 [============================================================] Page 5 of 4 ChildProcess.exithandler (child_process.js:204:12) emitTwo (events.js:106:13) ChildProcess.emit (events.js:191:7) maybeClose (internal/child_process.js:886:16) Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

The only thing I notice is that on the Printing step, the last thing it says in Page 5 of 4, and I have no idea why it would do that.

Thanks in advance to anyone who can help shed some light on this.

pofider commented 6 years ago

Did you try to use bigger VM? There can be for example a memory issue. You could also try to simplify css in the report. One option is also try to use chrome recipe instead.

Unfortunately this is an issue with wkhtmltopdf rather than with jsreport and I cannot help you more on this here.

asaltiel72 commented 6 years ago

I have confirmed it is an issue with WKHTMLTOPDF. I am working on a resolution to use until there is an actual resolution for that.

Thanks for the response