Config file not applied?
-
I'm having timeout problems. After increasing the limits to ridiculous levels (300 seconds) for all timeout settings I know about, I still get timeouts (much earlier than 300 seconds).
I'm building a docker image based on the official 2.5 image.
My Dockerfile:
FROM jsreport/jsreport:2.5.0 COPY license-key.txt /app RUN cd /app && npm install \ moment \ moment-timezone \ intl \ dd-trace \ handlebars-helpers \ node-fetch \ jsreport-assets \ jsreport-static-pdf
In a mounted folder I have jsreport.config.json, which looks like this (this file is in the same folder as jsreport.license.json, which is the root of the mounted folder tree):
{ "httpPort": 5488, "allowLocalFilesAccess": true, "store": { "provider": "fs" }, "blobStorage": { "provider": "fs" }, "templatingEngines": { "timeout": 300000, }, "chrome": { "timeout": 300000 }, "extensions": { "scripts": {"timeout": 300000}, "express": { "inputRequestLimit": "50mb" }, "child-templates": { "parallelLimit": 5 } } }
Here is what I get:
Error: Timeout during evaluation of pdf-utils operations at Timeout._onTimeout (/app/node_modules/script-manager/lib/manager-servers.js:154:23) at listOnTimeout (internal/timers.js:531:17) at processTimers (internal/timers.js:475:7)
Is there any way to see the current config params from within Studio? I'm suspecting that my config doesn't get applied.
-
More info: The timeout occurs after exactly 30 seconds.
The same report, with same data finishes after 38 seconds on my local jsreport server. This is exactly the same docker image as I deploy to AWS Aurora. To be sure I just did a rebuild of the image and re-deployed it, problem persists.
-
What if you put a typo to the
jsreport.config.json
to make it an invalid json. Does the jsreport start afterward? This way you can easily find out if the config file is used or not.The config looks correct and the timeout for pdf utils should be 300s.
Btw in the jsreport 2.6.0 there is no timeout for the pdf utils.
https://github.com/jsreport/jsreport/issues/563
-
Thanks.
I have now done two things, and it seems to work. Unfortunately, it's quite cumbersome to research since my servers are at AWS. After every change I have to build an image, upload to AWS, wait for it to start, and when it's started I have to import all my templates again (server runs on Fargate with ephemeral storage).I did:
- Upgrade to 2.6
- Build the image with no-cache, like this:
docker build --no-cache ...
Is there really no way of seeing the active config params from within studio? Can I reach them via script or helper?
-
Is there really no way of seeing the active config params from within studio? Can I reach them via script or helper?
I am afraid no, only some options are exposed to the studio through http://localhost:5488/api/extensions
You would need to modify your server.js and expose config for example to the api usingjsreport.on('express-configure', (app) => { app.get('/api/config', (req, res) => res.send(JSON.stringify(jsreport.options))) })
-
Ok,
Please make this into a feature request. It would be great to be able to pull out config data from the server or even show it in the about-dialog in Studio.
-
It wouldn't be secure to expose connection strings and other secrets this way. However, we will consider it as an opt-in option you can enable in config. Thank you.
-
It can be tracked here https://github.com/jsreport/jsreport/issues/635
-
How about just letting us add a version number to the config json and expose this. It would at least be a way ow knowing if your new config has been applied.
{ "version": 12, "httpPort": 5488, "allowLocalFilesAccess": true, "store": { "provider": "fs" },
-
Problem solved!
Kind of a face-palm.. But I might be forgiven due to the fact that Jan didn't catch the problem in my Dockerfile either =)RTFM!
It's quite clear, in the documentation about customising the docker image, that the config file needs to be copied into the image. The timeouts were working fine in my local dev environment because the config file was present in the mounted folder.
-
Just to clarify for others if you end up in the same place (i.e. didn't RTFM)
Here is my shiny new Dockerfile which makes use of the config file by copying it into the docker image from my mounted folder (yes, the folder name is "mounted").
FROM jsreport/jsreport:2.6.0 COPY license-key.txt /app COPY ./mounted/jsreport.config.json /app RUN cd /app && npm install \ moment \ moment-timezone \ intl \ dd-trace \ handlebars-helpers \ node-fetch \ jsreport-assets \ jsreport-static-pdf