Render Preview failed. network error jsreport
-
I have deployed jsreport on AWS as an ECS instance, when I run it, I often get 503 errors which I assume is happening because the server is overloaded. Now what I wish to know is, if a server is overloaded, will it give me an error while rendering a template. I am getting.
Render Preview failed. network error jsreport
What exactly does this error mean?
-
503 error comes from the ECS infrastructure and not jsreport itself.
Try to inspect the server logs of jsreport and also ECS infrastructure.
-
Render Preview failed. network error
TypeError: network error
What does this error mean and why does it come?
I am getting this error besides the 503.This is what's there in my log.
2022-07-18T20:01:54.788+05:30 2022-07-18T14:31:54.787Z - [32minfo[39m: Render request 1 queued for execution and waiting for availible worker rootId=q9vby0n0z3xauob, id=q9vby0n0z3xauob 2022-07-18T20:01:54.913+05:30 2022-07-18T14:31:54.913Z - [32minfo[39m: Starting rendering request 1 (user: null) rootId=q9vby0n0z3xauob, id=q9vby0n0z3xauob 2022-07-18T20:01:54.914+05:30 2022-07-18T14:31:54.914Z - [32minfo[39m: Rendering template { name: report_pdf, recipe: chrome-pdf, engine: handlebars, preview: true } rootId=q9vby0n0z3xauob, id=q9vby0n0z3xauob 2022-07-18T20:01:54.914+05:30 2022-07-18T14:31:54.914Z - [34mdebug[39m: Adding sample data B1a6s53DH rootId=q9vby0n0z3xauob, id=q9vby0n0z3xauob 2022-07-18T20:01:54.914+05:30 2022-07-18T14:31:54.914Z - [34mdebug[39m: Base url not specified, skipping its injection. rootId=q9vby0n0z3xauob, id=q9vby0n0z3xauob 2022-07-18T20:01:54.915+05:30 2022-07-18T14:31:54.915Z - [34mdebug[39m: Replaced assets ["styles.css","bootstrap.min.css","ProximaNova-Regular.otf","ProximaNovaExtrabold.otf","ProximaNovaThin.otf","colorbar_grayscale.jpg","colorbar_rb.jpg","thermalytixwriteupFile.png","thermalytixwriteupFile.png","colorbar_grayscale.jpg","colorbar_rb.jpg","colorbar_rb.jpg","colorbar_grayscale.jpg","thermalytixwriteupFile.png"] rootId=q9vby0n0z3xauob, id=q9vby0n0z3xauob 2022-07-18T20:01:55.021+05:30 2022-07-18T14:31:55.021Z - [34mdebug[39m: Replaced assets ["MGM_logo.jpg","HCGahmedabad.jpeg","KCHRC.jpg","TLC_logo.png"] rootId=q9vby0n0z3xauob, id=q9vby0n0z3xauob 2022-07-18T20:01:55.022+05:30 2022-07-18T14:31:55.022Z - [34mdebug[39m: Rendering engine handlebars rootId=q9vby0n0z3xauob, id=q9vby0n0z3xauob
-
TypeError: network error
What does this error mean and why does it come?jsreport studio uses javascript
fetch
to communicate with the server. This is implemented by the browser and the error is also thrown by the browser. The message is different also based on the browser. But in general, it means there was a networking problem when communicating with the server. It something jsreport has no influence on.Thank you for the logs. Unfortunately, there is no error, this could mean that the process or whole container was halted by the infrastructure.
Aren't you able to get some more information from AWS/some cloudwatch? We don't use ECS in our services so I'm not familiar with it.
-
Yes, that is all I got in the logs unfortunately, It is a problem with the Infrastructure. But still thank you for your time, I will update this post when I get it working in case someone in the future faces the same issue.
-
How much memory does jsReport need? I have assigned 1024MB to it and it still gives me 503. It has me confused.
-
That will be sure enough for simple reports.
You can always try it locally and inspect the memory consumption.
-
Thank you so much for answering!
For someone who faces something similar in the future.
I got it sorted out, apparently, AWS has a feature that checks if a service is healthy or not by checking an endpoint at a set interval of time. By default it is set for the route/
whereas jsReport we can set it as/api/ping
It is something I missed, therefore even though there was apt memory for jsReport to operate because the health endpoint failed, AWS assumed that the service is down or has some issues in it. Thereby the 503 error.Note, that this error earlier was happening because of less memory assigned to it.
-
Excellent! Thank you for sharing the solution.