Error when launching a report



  • npmbox likely didn't bundle/install the phantomjs.exe correctly.
    I would recommend to simply compress your local application directory, upload it to the server and decompress there. You don't need to use npmbox.

    I've updated the FAQ with more verbose recommendations how to perform production deployment.
    https://jsreport.net/learn/faq#deploy-to-production



  • Hi Blaha,
    Thanks again. I tried copying my local application to server & tried launching hello world template. That worked successfully. I am using wkhtmltopdf extension in my project report which fails with following error. Could you please advise what could be wrong here? The same report works in my local instance.

    2017-04-12T12:34:02.653Z - error: Error when processing render request Error during rendering report: spawn C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe ENOENT Error: spawn C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9) requestId=1
    2017-04-12T12:34:02.658Z - error: Error during processing request: http://localhost:5488/api/report details: Error during rendering report: spawn C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe ENOENT Error: spawn C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)



  • Sorry, Please ignore the above exception. I actually get the below error, I have replaced actual proxy server name from the error message I actually get. Please advice

    2017-04-12T12:56:33.625Z - error: Error when processing render request Error during rendering report: Command failed: C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --debug-javascript --proxyservername:8080 --margin-top 20mm --header-spacing 2 --header-html file:///C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6header.html toc C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.html C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.pdf
    Error: Command failed: C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --debug-javascript --proxy proxyservername:8080 --margin-top 20mm --header-spacing 2 --header-html file:///C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6header.html toc C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.html C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.pdf

    at ChildProcess.exithandler (child_process.js:206:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:498:12) requestId=1
    

    2017-04-12T12:56:33.627Z - error: Error during processing request: http://localhost:5488/api/report details: Error during rendering report: Command failed: C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --debug-javascript --proxy proxyservername:8080 --margin-top 20mm --header-spacing 2 --header-html file:///C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6header.html toc C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.html C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.pdf
    Error: Command failed: C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --debug-javascript --proxy proxyservername:8080 --margin-top 20mm --header-spacing 2 --header-html file:///C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6header.html toc C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.html C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.pdf

    at ChildProcess.exithandler (child_process.js:206:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:498:12)


  • Ouch, this is our bug in wkhtmltopdf recipe. We use there absolute path which prevents it from being simply copy pasted to the different location.

    Please try this workaround... Find this file node_modules\wkhtmltopdf-installer\lib\location.js
    and change the absolute path inside to the path corresponding with your server location

    This should work for you right now. Otherwise wait until we fix this bug.
    https://github.com/pofider/node-wkhtmltopdf-installer/issues/6



  • Hi Blaha, regarding the issue you mentioned about the absolute path, I worked around that by creating similar folder structure in the server as well. Now I get a different error message which I believe is not related to the path issue you mentioned above. The recent error message I receive now is below.

    2017-04-12T12:56:33.625Z - error: Error when processing render request Error during rendering report: Command failed: C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --debug-javascript --proxy proxyservername:8080 --margin-top 20mm --header-spacing 2 --header-html file:///C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6header.html toc C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.html C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.pdf
    Error: Command failed: C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --debug-javascript --proxy proxyservername:8080 --margin-top 20mm --header-spacing 2 --header-html file:///C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6header.html toc C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.html C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.pdf

    at ChildProcess.exithandler (child_process.js:206:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:498:12) requestId=1
    

    2017-04-12T12:56:33.627Z - error: Error during processing request: http://localhost:5488/api/report details: Error during rendering report: Command failed: C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --debug-javascript --proxy proxyservername:8080 --margin-top 20mm --header-spacing 2 --header-html file:///C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6header.html toc C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.html C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.pdf
    Error: Command failed: C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --debug-javascript --proxy proxyservername:8080 --margin-top 20mm --header-spacing 2 --header-html file:///C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6header.html toc C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.html C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.pdf

    at ChildProcess.exithandler (child_process.js:206:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:498:12)


  • Please try to run the failing command in the command line and see what it outputs

    C:\JSTest\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --debug-javascript --proxy proxyservername:8080 --margin-top 20mm --header-spacing 2 --header-html file:///C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6header.html toc C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.html C:\Users\pxa0683\AppData\Local\Temp\5\jsreport-temp\74179660-1f7f-11e7-8fe4-d124996c7ce6.pdf
    

    Make sure you run the command right after the rendering fails, because the temporary files get removed in 2 minutes by default.



  • I get the following message.

    The program can not start because MSVCR120.dll is missing from your computer, try reinstall to fix the problem.



  • I see... This is because your server doesn't contain windows c++ redistributable on which wkhtmltopdf depends.

    I recommend to download it and install on the server through the wkhtmltopdf installer
    https://downloads.wkhtmltopdf.org/0.12/0.12.3.2/



  • I will try installing this in server & will let you know how it goes. thanks


  • administrators

    the issue about the absolute path for wkhtmltopdf.exe was fixed in jsreport-wkhtmltopdf v1.3.1 👍


Log in to reply
 

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