Error in generating report in Linux (Ubuntu 16.04) VPS
-
Iam using Linux VPS(ubuntu 16.04), with NodeJS server which is using jsreport and phantom PDF recipe for dynamic PDF generation.
Please find the versions of packages that I have installed for this"jsreport": "^2.5.0", "jsreport-phantom-pdf": "^2.3.0"
But on rendering, this is failing with below error.
Please Note :- This is working fine in my Local Windows Server.
{ Error: Command failed: /node_modules/phantomjs/lib/phantom/bin/phantomjs --ignore-ssl-errors=yes --web-security=false --ssl-protocol=any /node_modules/phantom-html-to-pdf/lib/scripts/standaloneScript.js /tmp/jsreport/autocleanup/74d65374-d25e-4300-8f37-0d4e52911c59settings.html PhantomJS has crashed. Please read the crash reporting guide at https://github.com/ariya/phantomjs/wiki/Crash-Reporting and file a bug report at https://github.com/ariya/phantomjs/issues/new with the crash dump file attached: /tmp/7dee0f27-259c-8454-34e1fe34-16cf8734.dmp , Segmentation fault error: if you are using macOS Sierra with phantomjs < 2 remember that phantomjs < 2 does not work there and has bugs (https://github.com/ariya/phantomjs/issues/14558), try to upgrade to phantom 2 if using macOS Sierra at ChildProcess.exithandler (child_process.js:294:12) at ChildProcess.emit (events.js:198:13) at maybeClose (internal/child_process.js:982:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) cause: { Error: Command failed: /node_modules/phantomjs/lib/phantom/bin/phantomjs --ignore-ssl-errors=yes --web-security=false --ssl-protocol=any /node_modules/phantom-html-to-pdf/lib/scripts/standaloneScript.js /tmp/jsreport/autocleanup/74d65374-d25e-4300-8f37-0d4e52911c59settings.html PhantomJS has crashed. Please read the crash reporting guide at https://github.com/ariya/phantomjs/wiki/Crash-Reporting and file a bug report at https://github.com/ariya/phantomjs/issues/new with the crash dump file attached: /tmp/7dee0f27-259c-8454-34e1fe34-16cf8734.dmp , Segmentation fault error: if you are using macOS Sierra with phantomjs < 2 remember that phantomjs < 2 does not work there and has bugs (https://github.com/ariya/phantomjs/issues/14558), try to upgrade to phantom 2 if using macOS Sierra at ChildProcess.exithandler (child_process.js:294:12) at ChildProcess.emit (events.js:198:13) at maybeClose (internal/child_process.js:982:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) killed: false, code: null, signal: 'SIGSEGV', cmd: '/node_modules/phantomjs/lib/phantom/bin/phantomjs --ignore-ssl-errors=yes --web-security=false --ssl-protocol=any /node_modules/phantom-html-to-pdf/lib/scripts/standaloneScript.js /tmp/jsreport/autocleanup/74d65374-d25e-4300-8f37-0d4e52911c59settings.html' }, isOperational: true, killed: false, code: null, signal: 'SIGSEGV', cmd: '/node_modules/phantomjs/lib/phantom/bin/phantomjs --ignore-ssl-errors=yes --web-security=false --ssl-protocol=any /node_modules/phantom-html-to-pdf/lib/scripts/standaloneScript.js /tmp/jsreport/autocleanup/74d65374-d25e-4300-8f37-0d4e52911c59settings.html', logged: true }
-
Does it fail only for particular templates or even for "Hello world" pdf?
Please try to install the required phantomjs deps mentioned in the docs https://jsreport.net/learn/ubuntu
sudo apt-get install -y --no-install-recommends gnupg git curl wget ca-certificates sudo apt-get install -y --no-install-recommends xfonts-base xfonts-75dpi
-
Thanks @jan_blaha for the quick response. Resolved the issue. The error was due to insufficient memory on the VPS.