I figured it out, I had to go under EC2 to Load Balancers and set the load balancer timeout to a higher value. Thanks for helping me troubleshoot!
Posts made by MKuenzi
-
RE: 504 Gateway Time-out With Long Report (1000+ pageS)
-
RE: 504 Gateway Time-out With Long Report (1000+ pageS)
OK, I've tried it locally and you are right it works without any issues.
I am using Amazon Elastic Beanstalk and a modified jsreport Docker image.
-
RE: 504 Gateway Time-out With Long Report (1000+ pageS)
Hi Jan,
So I think this may be a JS Report problem actually. I ran through increasing all the nginx timeouts with no luck, so I disabled nginx and ran it straight through to jsreport. I got a 504 Gateway Timeout. But then, I went a step further and replaced my sample document data in the web interface with what I'm trying to render. Lo and behold, I get a 504 Gateway Timeout in the web interface
Any ideas?
Thanks,
Mike -
RE: 504 Gateway Time-out With Long Report (1000+ pageS)
Yes, I think you right, sorry!
UPDATE: So I am posting 2.4 MBs of data to nginx. I have my client_max_body_size set higher than that so that is not the problem.
Once I perform this post the server seems to go down on me. It takes a few minutes to happen, perhaps it's a RAM thing? I'll have to look into it more...
-
504 Gateway Time-out With Long Report (1000+ pageS)
Hi, I am getting a 504 Gateway Time-out error when sending a request with a large amount of data. As you can see I am posting to the JS Report Server using the .NET API. I tried using the Timeout property on RenderOptions, it didn't seem to help. I also tried to increase the reportTimeout as specified in my jsreport.config.json, that didn't seem to help either, any ideas?
jsreport.Client.JsReportException: 'Unable to render template. <html> <head><title>504 Gateway Time-out</title></head> <body> <center><h1>504 Gateway Time-out</h1></center> </body> </html> '
-
RE: HeadlessChrome error: ERROR: The requested object does not exist.
@vadnala I think this is when I ended up moving the jsreport server to Amazon EBS and it worked fine. So I never figured it out, I just moved to a new environment, I'm using Docker in conjunction with jsreport and deploying with EBS.
-
RE: Docker Web GUI broken in 2.10?
After a day of tinkering around with this I realize this is an issue I am running into with Amazon Elastic Beanstalk. I tried to do everything to invalidate the Dockerfile (I'm not pulling the image from a docker repository to avoid the additional complexity, I am simply uploading to EBS from my jsreport folder). I tried creating a new environment under my existing EBS application, that didn't work.
The best solution seems to be to just start a new application up from scratch in EBS, which did work on the first try.
Thanks Jan
-
Docker Web GUI broken in 2.10?
Hi I am deploying my jsreport server using docker and AWS Elastic Beanstalk and I am seeing this after updating to 2.10 in the Web GUI, which results in an infinite spinner:
My Dockerfile looks like this:
FROM jsreport/jsreport:2.9.0 COPY ["data", "data"] COPY ["jsreport.config.json", "jsreport.config.json"] # we want to preserve the chrome version of 2.7.1 and just update the jsreport RUN npm install jsreport@2.10.0 && npm cache clean -f USER root CMD ["bash", "/app/run.sh"] EXPOSE 80
Am I doing something wrong or is there an issue with jsreport?
Thanks,
Mike -
RE: Customizing nginx request size limit in docker image
I am using Amazon Elastic Beanstalk to host the jsreport docker image. I didn't realize Elastic Beanstalk itself was using nginx, so I will resolve it by looking at the Amazon documentation.
Thanks for pointing me in the right direction!
-
Customizing nginx request size limit in docker image
Hello,
Using Docker, I was wondering what the easiest way is to customize the nginx
client_max_body_size SIZE;
config, to allow for bigger requests when using the docker image.I assume I might have to use a COPY command or something to overwrite the nginx configuration inside of the docker image but I figured I would run it by you to see if I can do something easier.
Thanks,
Mike -
RE: Unexpected end of JSON input
Thanks Jan,
I ended up doing a deploy to production with the Enterprise license applied. For some reason, the deploy fixed it.
I'll look into this further on this thread with your suggestions if I run into this again!
-
Unexpected end of JSON input
I'm getting a really interesting error when I try to render a report. I have identical report data that I'm rendering on both my dev and my production environment. Both of these environments are running off the jsreport docker image and both of them are hosted on Amazon Elastic Beanstalk.
The only difference I can spot is I have the enterprise license applied in dev where it is not yet applied in production.
In production I am getting this error:
Unexpected end of JSON input SyntaxError: Unexpected end of JSON input at JSON.parse () at parseGroup (/app/node_modules/jsreport-pdf-utils/lib/utils/parsePdf.js:18:20) at module.exports (/app/node_modules/jsreport-pdf-utils/lib/utils/parsePdf.js:78:25) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Object.parse (/app/node_modules/jsreport-pdf-utils/lib/utils/pdfManipulator.js:13:28) at async module.exports (/app/node_modules/jsreport-pdf-utils/lib/scriptPdfProcessing.js:49:7)
I have verified the JSON is indeed intact, and if I point my dev environment to run using the production report server, it errors.
Here's the complete production output: (Redacted the data)
+0 Starting rendering request 1291 (user: user) +2 Rendering template { name: sales-order, recipe: chrome-pdf, engine: handlebars, preview: false } +2 Inline data specified. +2 Resources not defined for this template. +3 Executing script common.js +14 Base url not specified, skipping its injection. +16 Replaced assets ["common.css","sales-order.css"] +16 Rendering engine handlebars +23 Taking compiled template from engine cache +23 Pdf utils adding item field, value: 183350 +24 Pdf utils adding group field, value: +24 Pdf utils adding item field, value: 187585 +24 Pdf utils adding group field, value: +24 Pdf utils adding item field, value: 184655 +24 Pdf utils adding group field, value: +24 Pdf utils adding item field, value: 184880 +25 Pdf utils adding group field, value: +25 Pdf utils adding item field, value: 187312 +25 Pdf utils adding group field, value: +25 Pdf utils adding item field, value: 186023 +25 Pdf utils adding group field, value: +25 Pdf utils adding item field, value: 184175 +25 Pdf utils adding group field, value: +25 Pdf utils adding item field, value: 187582 +26 Pdf utils adding group field, value: +26 Pdf utils adding item field, value: 187552 +26 Pdf utils adding group field, value: +26 Pdf utils adding item field, value: 187635 +26 Pdf utils adding group field, value: +26 Pdf utils adding item field, value: 184807 +26 Pdf utils adding group field, value: +26 Pdf utils adding item field, value: 183607 +27 Pdf utils adding group field, value: +27 Pdf utils adding item field, value: 184521 +27 Pdf utils adding group field, value: +27 Pdf utils adding item field, value: 183528 +27 Pdf utils adding group field, value: +27 Pdf utils adding item field, value: 185088 +27 Pdf utils adding group field, value: +27 Pdf utils adding item field, value: 183373 +28 Pdf utils adding group field, value: +51 Executing recipe chrome-pdf +231 Converting with chrome HeadlessChrome/76.0.3809.132 using dedicated-process strategy +747 Running chrome with params {"marginTop":".5cm","marginRight":".5cm","marginBottom":"2cm","marginLeft":".5cm","margin":{"top":".5cm","right":".5cm","bottom":"2cm","left":".5cm"},"printBackground":true} +1938 pdf-utils is starting pdf processing
And here is my complete dev output:
+0 Starting rendering request 21 (user: user) +1 Rendering template { name: sales-order, recipe: chrome-pdf, engine: handlebars, preview: false } +2 Inline data specified. +2 Resources not defined for this template. +3 Executing script common.js +26 Base url not specified, skipping its injection. +28 Replaced assets ["common.css","sales-order.css"] +28 Rendering engine handlebars +35 Taking compiled template from engine cache +36 Pdf utils adding item field, value: 183350 +36 Pdf utils adding group field, value: +36 Pdf utils adding item field, value: 187585 +36 Pdf utils adding group field, value: +36 Pdf utils adding item field, value: 184655 +37 Pdf utils adding group field, value: +37 Pdf utils adding item field, value: 184880 +37 Pdf utils adding group field, value: +37 Pdf utils adding item field, value: 187312 +37 Pdf utils adding group field, value: +37 Pdf utils adding item field, value: 186023 +37 Pdf utils adding group field, value: +37 Pdf utils adding item field, value: 184175 +38 Pdf utils adding group field, value: +38 Pdf utils adding item field, value: 187582 +38 Pdf utils adding group field, value: +38 Pdf utils adding item field, value: 187552 +38 Pdf utils adding group field, value: +38 Pdf utils adding item field, value: 187635 +39 Pdf utils adding group field, value: +39 Pdf utils adding item field, value: 184807 +39 Pdf utils adding group field, value: +39 Pdf utils adding item field, value: 183607 +39 Pdf utils adding group field, value: +39 Pdf utils adding item field, value: 184521 +39 Pdf utils adding group field, value: +39 Pdf utils adding item field, value: 183528 +40 Pdf utils adding group field, value: +40 Pdf utils adding item field, value: 185088 +40 Pdf utils adding group field, value: +40 Pdf utils adding item field, value: 183373 +40 Pdf utils adding group field, value: +46 Executing recipe chrome-pdf +204 Converting with chrome HeadlessChrome/76.0.3809.132 using dedicated-process strategy +707 Running chrome with params {"marginTop":".5cm","marginRight":".5cm","marginBottom":"2cm","marginLeft":".5cm","margin":{"top":".5cm","right":".5cm","bottom":"2cm","left":".5cm"},"printBackground":true} +1902 pdf-utils is starting pdf processing +1907 Detected 1 pdf operation(s) to process +2284 Running pdf operation merge +2285 Starting rendering request 22 (user: chipply) +2286 Rendering template { name: sales-order-footer, recipe: chrome-pdf, engine: handlebars, preview: false } +2287 Inline data specified. +2287 Resources not defined for this template. +2288 Base url not specified, skipping its injection. +2289 Replaced assets ["sales-order.css"] +2289 Rendering engine handlebars +2301 Taking compiled template from engine cache +2303 Executing recipe chrome-pdf +2433 Converting with chrome HeadlessChrome/76.0.3809.132 using dedicated-process strategy +2721 Running chrome with params {"marginTop":"","marginLeft":"1cm","marginRight":"1cm","margin":{"top":"","right":"1cm","left":"1cm"},"printBackground":true} +2791 Skipping storing report. +2792 Rendering request 22 finished in 507 ms +2966 pdf-utils pdf processing was finished +2971 Skipping storing report. +2987 Rendering request 21 finished in 2987 ms
-
RE: HeadlessChrome error: ERROR: The requested object does not exist.
This happens for all my templates on that machine.
I cannot replicate the issue on the development environment...
There definitely is enough memory (RAM, Storage) on the production machine.
I tried updating puppeteer but it didn't help. Nothing has changed configuration wise here outside of potentially some kind of automatic update on the server.
Very weird, I tried copying a fresh server folder and doing npm install, jsreport start and that didn't help me either.
I guess I can try manually restarting the server tonight and see if that fixes it.
-
HeadlessChrome error: ERROR: The requested object does not exist.
Hello, I have been using jsreports in a production environment with no problems until today. It seems that headless chrome is having issues, I tried changed the recipe to other types and I do not receive an error unless it's headless-chrome:
2020-02-03T15:34:13.912Z - debug: Converting with chrome HeadlessChrome/76.0.3803.0 using dedicated-process strategy 2020-02-03T15:34:14.186Z - debug: Running chrome with params {"marginTop":".5cm","marginRight":".5cm","marginBottom":"2cm","marginLeft":".5cm","margin":{"top":".5cm","right":".5cm","bottom":"2cm","left":".5cm"},"printBackground":true} ERROR: The requested object does not exist.
Any advice?
Thanks,
Mike -
RE: TypeError: The header content contains invalid characters when encountering ™©®’
Nevermind after looking through your source code it turned out to be easier than I thought (I thought I had to pass the template etc based on the documentation)
var rs = new ReportingService("http://localhost:5488"); var report = await rs.RenderAsync(new RenderRequest() { Template = new Template() { Name = "sales-order" }, Data = data, Options = new RenderOptions() { Debug = new DebugOptions() { LogsToResponseHeader = false } } });
Just a thought, if the Name property said something about the name of the template to render I would have intuitively tried it. (Right now it says "Readable name, does not need to be unique")
-
RE: TypeError: The header content contains invalid characters when encountering ™©®’
I might just wait for the next release then, it seems the .NET API defaults to having this option on.
Could you add a way to pass the options in when using RenderByNameAsync? It's too cumbersome for me to switch to using RenderAsync at this point, but if logToResponseHeader is set to false (or the bug is fixed) for .NET then I don't need the ability to pass options anyways.
Thanks for the support, love the product so far!
-
TypeError: The header content contains invalid characters when encountering ™©®’
Hello. I am receiving this error when I am am running JSReport as a standalone server. The exact error I get is as follows:
2019-08-09T19:46:10.858Z - error: Error during processing request at http://localhost:5488/api/report, details: The header content contains invalid characters, stack: TypeError: The header content contains invalid characters at validateHeader (_http_outgoing.js:494:11) at ServerResponse.setHeader (_http_outgoing.js:498:3) at reporter.render.then (D:\Git\Main2\node_modules\jsreport-express\lib\routes.js:59:15) at <anonymous>
I have a playground example at https://playground.jsreport.net/w/anon/YhNEBvSB but I am unable to duplicate it in the browser, so it might be specific to submitting a request to the standalone node JS Report Server?
I updated to node 10.16.2 and I now get this:
2019-08-09T21:00:40.254Z - error: Error during processing request at http://localhost:5488/api/report, details: Invalid character in header content ["Debug-Logs"], stack: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Debug-Logs"] at ServerResponse.setHeader (_http_outgoing.js:473:3) at reporter.render.then (D:\Git\Main2\node_modules\jsreport-express\lib\routes.js:59:15)
Also my jsreport.config.json looks like this:
{ "extensions": { "authentication": { "cookieSession": { "secret": "<your strong secret here>" }, "admin": { "username": "admin", "password": "password" }, "enabled": false }, "scripts": { "timeout": 40000, "strategy": "http-server" } }, "httpPort": 5488, "store": { "provider": "fs" }, "blobStorage": { "provider": "fs" }, "logger": { "console": { "transport": "console", "level": "debug" }, "file": { "transport": "file", "level": "info", "filename": "logs/reporter.log" }, "error": { "transport": "file", "level": "error", "filename": "logs/error.log" } }, "allowLocalFilesAccess": true, "templatingEngines": { "timeout": 60000, "strategy": "http-server" }, "chrome": { "timeout": 40000 } }
-
RE: Long reports return: Unable to render template. Timeout during evaluation of pdf-utils operations
Thanks a lot I will try that in the future. I actually realized I can just use the native Chrome footer for this after reading https://forum.jsreport.net/topic/1116/jsreport-native-header-footer-issue (I wasn't seeing the footer because I didn't set the margin like the OP) so that solution is working for me, but I will check that out if I need a more advanced solution.
-
Long reports return: Unable to render template. Timeout during evaluation of pdf-utils operations
Hello,
The full exception is:
jsreport.Client.JsReportException: 'Unable to render template. Timeout during evaluation of pdf-utils operations'
I seem to receive this any time I am rendering a report 30 pages or over. pdf-utils is setup to perform a merge of a page footer for each page.
Here is the config.json of my "master" template:
{ "folder": { "shortid": "ITA_ZvJ" }, "shortid": "B1lecBzF1B", "name": "sales-order", "recipe": "chrome-pdf", "engine": "handlebars", "chrome": { "printBackground": true, "displayHeaderFooter": false }, "creationDate": "2019-06-20T14:20:13.845Z", "modificationDate": { "$$date": 1561409017044 }, "_id": "BXlf7xpYCnmvS5l1", "$entitySet": "templates", "data": { "shortid": "BJeiXcfFJr" }, "pdfOperations": [ { "type": "merge", "templateShortid": "H1xcBlBK1B", "enabled": true, "renderForEveryPage": true, "mergeWholeDocument": false } ] }
And here is the config.json for the footer:
{ "folder": { "shortid": "ITA_ZvJ" }, "shortid": "H1xcBlBK1B", "name": "sales-order-footer", "recipe": "chrome-pdf", "engine": "handlebars", "chrome": { "printBackground": true }, "creationDate": "2019-06-20T17:20:28.090Z", "modificationDate": { "$$date": 1561124362090 }, "_id": "cb4JxG0tbxJe9e6E", "$entitySet": "templates" }
And the template of the footer:
<div style="position: absolute; bottom: 10px">Page {{$pdf.pageNumber}} of {{$pdf.pages.length}}</div>
I need to be able to generate reports that have many more than just 30 pages, potentially around 500. Is there a way to increase the timeout for pdf-utils?
Let me know if you need any more information like the main template contents (it is essentially an order receipt with product images).
Thanks in advance!
Mike
-
RE: win-install reports error of no "start" or "main" script in package.json
Ah, okay I ran jsrpeport init again in an empty directory and I saw the start script does get created. Sorry about that, I must have screwed something up along the way.
Love the product by the way keep up the good work!