Socket time-out whenever the reports is rendered for more than 5 seconds (i have only 60 pages pdf)
-
I notice that when ever the report was rendered less than 5 seconds, the report show on my app, but if it more than that, my app fails to get it. I read this https://jsreport.net/blog/long-reports and implement the settings for chome-pdf, but still i got the issue after update the config. By the way i was using the
jsreport/jsreport:2.5.0
from docker hubextensions_authentication_admin_username=admin extensions_authentication_admin_password=guessmeifyoucan extensions_authentication_cookieSession_secret=long-secret extensions_express_renderTimeout=600000 extensions_mongodb-store_uri=<intentionally-remove-but-i-can-confirm-that-this-works> extensions_mongodb-store_prefix=jsreport_ templatingEngines_timeout=600000 templatingEngines_strategy=http-server templatingEngines_numberOfWorkers=4 chrome_timeout=600000 store_provider=mongodb
Here is the environment variables that i setup, i can confirm that this is being used because when-ever i change a value that this not valid, jsreport throws error (e.g. i change the store_provider=not-exists)
2019-07-15T16:09:03.194808568Z 2019-07-15T16:09:03.194Z - info: Rendering template { name: /sf9/template-inside, recipe: chrome-pdf, engine: handlebars, preview: false } 2019-07-15T16:09:06.884946962Z 2019-07-15T16:09:06.884Z - info: Rendering request 3 finished in 5469 ms 2019-07-15T16:09:08.278518458Z 2019-07-15T16:09:08.278Z - info: Rendering request 4 finished in 5102 ms
And here is the error i got from my app
2019-07-15T15:37:22.476205646Z Error: ESOCKETTIMEDOUT 2019-07-15T15:37:22.476238940Z at ClientRequest.<anonymous> (/usr/src/app/node_modules/request/request.js:816:19) 2019-07-15T15:37:22.476251835Z at Object.onceWrapper (events.js:313:30) 2019-07-15T15:37:22.476259179Z at emitNone (events.js:106:13) 2019-07-15T15:37:22.476265953Z at ClientRequest.emit (events.js:208:7) 2019-07-15T15:37:22.476272457Z at TLSSocket.emitTimeout (_http_client.js:711:34) 2019-07-15T15:37:22.476278983Z at Object.onceWrapper (events.js:313:30) 2019-07-15T15:37:22.476285919Z at emitNone (events.js:106:13) 2019-07-15T15:37:22.476292279Z at TLSSocket.emit (events.js:208:7) 2019-07-15T15:37:22.476298806Z at TLSSocket.Socket._onTimeout (net.js:420:8) 2019-07-15T15:37:22.476305433Z at ontimeout (timers.js:482:11) 2019-07-15T15:37:22.476311855Z at tryOnTimeout (timers.js:317:5) 2019-07-15T15:37:22.476318321Z at Timer.listOnTimeout (timers.js:277:5) 2019-07-15T15:37:23.977099750Z Error: ESOCKETTIMEDOUT 2019-07-15T15:37:23.977116871Z at ClientRequest.<anonymous> (/usr/src/app/node_modules/request/request.js:816:19) 2019-07-15T15:37:23.977122485Z at Object.onceWrapper (events.js:313:30) 2019-07-15T15:37:23.977145631Z at emitNone (events.js:106:13) 2019-07-15T15:37:23.977151173Z at ClientRequest.emit (events.js:208:7) 2019-07-15T15:37:23.977155052Z at TLSSocket.emitTimeout (_http_client.js:711:34) 2019-07-15T15:37:23.977159157Z at Object.onceWrapper (events.js:313:30) 2019-07-15T15:37:23.977163150Z at emitNone (events.js:106:13) 2019-07-15T15:37:23.977167159Z at TLSSocket.emit (events.js:208:7) 2019-07-15T15:37:23.977171136Z at TLSSocket.Socket._onTimeout (net.js:420:8) 2019-07-15T15:37:23.977175056Z at ontimeout (timers.js:482:11) 2019-07-15T15:37:23.977178857Z at tryOnTimeout (timers.js:317:5) 2019-07-15T15:37:23.977182694Z at Timer.listOnTimeout (timers.js:277:5) 2019-07-15T16:09:06.415014279Z Error: ESOCKETTIMEDOUT 2019-07-15T16:09:06.415065000Z at ClientRequest.<anonymous> (/usr/src/app/node_modules/request/request.js:816:19) 2019-07-15T16:09:06.415089507Z at Object.onceWrapper (events.js:313:30) 2019-07-15T16:09:06.415096213Z at emitNone (events.js:106:13) 2019-07-15T16:09:06.415103372Z at ClientRequest.emit (events.js:208:7) 2019-07-15T16:09:06.415125578Z at TLSSocket.emitTimeout (_http_client.js:711:34) 2019-07-15T16:09:06.415131636Z at Object.onceWrapper (events.js:313:30) 2019-07-15T16:09:06.415136942Z at emitNone (events.js:106:13) 2019-07-15T16:09:06.415142341Z at TLSSocket.emit (events.js:208:7) 2019-07-15T16:09:06.415147655Z at TLSSocket.Socket._onTimeout (net.js:420:8) 2019-07-15T16:09:06.415153067Z at ontimeout (timers.js:482:11) 2019-07-15T16:09:06.415158331Z at tryOnTimeout (timers.js:317:5) 2019-07-15T16:09:06.415163762Z at Timer.listOnTimeout (timers.js:277:5) 2019-07-15T16:09:08.167171181Z Error: ESOCKETTIMEDOUT 2019-07-15T16:09:08.167225891Z at ClientRequest.<anonymous> (/usr/src/app/node_modules/request/request.js:816:19) 2019-07-15T16:09:08.167234873Z at Object.onceWrapper (events.js:313:30) 2019-07-15T16:09:08.167240033Z at emitNone (events.js:106:13) 2019-07-15T16:09:08.167245554Z at ClientRequest.emit (events.js:208:7) 2019-07-15T16:09:08.167250776Z at TLSSocket.emitTimeout (_http_client.js:711:34) 2019-07-15T16:09:08.167255899Z at Object.onceWrapper (events.js:313:30) 2019-07-15T16:09:08.167261152Z at emitNone (events.js:106:13) 2019-07-15T16:09:08.167266695Z at TLSSocket.emit (events.js:208:7) 2019-07-15T16:09:08.167283463Z at TLSSocket.Socket._onTimeout (net.js:420:8) 2019-07-15T16:09:08.167290010Z at ontimeout (timers.js:482:11) 2019-07-15T16:09:08.167295509Z at tryOnTimeout (timers.js:317:5) 2019-07-15T16:09:08.167300834Z at Timer.listOnTimeout (timers.js:277:5)
As you can see from here, it was throwing sockettime-out. from the request module, I did not use the request npm module but rather i used the
"jsreport-client": "^1.0.2",
, i'm not sure (but most probably jsreport client is using it). I used js-report client for getting the report.
-
After some thought, the jsReportClient is really the issue here. Actually there is a setting jsRepoClient that i overlooked, https://jsreport.net/learn/nodejs-client
at the bottom of the article named "Handling request timeout".So my issue is resolved here, and it can be tagged as resolve if necessary