js-report Timeout error during executing script
-
Hi,
We are using version 2.3.0 of js-report. after deploying in stacks, Initially it's working fine. after around 30 requests hit to js-report, we are facing error "Error when processing render request Timeout error during executing script Error: Timeout error during executing script". Once this error came, then we had to be killed & restarted the service. Then it's working & after around 30 or 40 requests, again same error.Can we please get the solution for this ASAP ?
This is the set in out package.json:
"dependencies": {
"chartjs-plugin-labels": "^1.1.0",
"jsreport": "^2.3.0",
"jsreport-chrome-pdf": "^1.2.1"
}This is the setting in our config:
"phantom": {
"strategy": "dedicated-process",
"timeout": 60000
},
"tasks": {
"strategy": "dedicated-process",
"timeout": 60000,
"allowedModules": "*"
},
"scripts": {
"allowedModules": [],
"timeout": 60000
}.another doubt that, Even though it's 60000, timeout happens in 10000ms.
Please let me know if you need more detail on this error.
Your immediate help is highly appreciated.
Thanks & Regards
Navaneeth.
-
Your configuration file won't work for jsreport version >=2.0
Use something like this instead{ "httpPort": 5488, "allowLocalFilesAccess": false, "store": { "provider": "fs" }, "blobStorage": { "provider": "fs" }, "templatingEngines": { "timeout": 10000 }, "chrome": { "timeout": 30000 }, "extensions": { "authentication" : { "cookieSession": { "secret": "<your strong secret>" }, "admin": { "username" : "admin", "password": "password" }, "enabled": false }, "sample-template": { "createSamples": true }, "scripts": { "timeout": 30000 } } }
-
Hi Jan,
I changed my config file as like you suggested. In stack, The same error "Error when processing render request Timeout error during executing script Error: Timeout error during executing script" is coming again.
This is for your reference that I've shared my config settings (jsreport.config.json)
{
"certificate": {
"key": "certificates/jsreport.net.key",
"cert": "certificates/jsreport.net.cert"
},
"connectionString": {
"name": "fs"
},
"httpPort": 9012,
"httpsPort": null,
"allowLocalFilesAccess": true,
"store": {
"provider": "fs"
},
"blobStorage": {
"provider": "fs"
},
"templatingEngines": {
"timeout": 20000
},
"chrome": {
"timeout": 30000
},
"extensions": {
"authentication" : {
"cookieSession": {
"secret": "<your strong secret>"
},
"admin": {
"username" : "admin",
"password": "password"
},
"enabled": false
},
"sample-template": {
"createSamples": true
},
"scripts": {
"timeout": 60000,
"allowedModules": ["fs"]
},
"phantom": {
"strategy": "dedicated-process",
"timeout": 60000
},
"tasks": {
"strategy": "dedicated-process",
"timeout": 60000,
"allowedModules": "*"
}
}
}And I want to add here that we are using custom script for some reports. in that script just we are updating some data, not big process we are doing there.
I'm tellig this only as the custom script. js-report/data/scripts/basicCharts/content.js
Hope, you have solution to resolve this issue.
-
Please replicate the issue in the playground
https://playground.jsreport.net/Based on the error you probably need to optimize the script you have.
-
OK. i'll check from my side to optimize / debug the scripts. but it works initially in stacks, after around 2 days only, the error is coming.
(if it's completely not working means, that's failure/error case. but here it's working for 2 days, then error will be coming, after killed & restarted the service, again it would be started to work for next 2 days around. and In localhost, we could't not able to get this error)
But, before upgraded, the same code was working around 10 months perfectly. after upgrade only this problem is happening.
I'll check by degrading the versions too.After i analysed today, i found that Third parameter is not needed for >2.0 versions. but still we kept that.
function beforeRender(req, res, done) {
done();
}Now i removed the third parameter. Let me check whether the error come again or not.
function beforeRender(req, res){
}Let me wait & check whether the error comes or not
-
Hi Jan,
After i removed 3rd parameter in scripts, the timeout error is not coming now. Here i referred https://jsreport.net/blog/jsreport-v2-released
Thank you Jan for the Support