JS Report Studio doesn't render reports, but can do it with api
-
Hi,
I have installed JSReport on my local machine. I use it to render some reports of my web application. Everything work fine. But when I try to create new report with Studio and render it, I get this error: Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:209:20)I reimported my reports with the import utility in Studio. The error is still there.
I use Windows 10 64 bits Pro and JS Report 2.11.0 (cli version 2.2.5) with NodeJS 14.8.0
Thanks
-
Please share the jsreport output logs for the start.
-
Here is the debug
read ECONNRESET logs: +0 Starting rendering request 1 (user: null) +4 Rendering template { name: invoice-main, recipe: chrome-pdf, engine: handlebars, preview: true } +7 Adding sample data Sy5S19ncg +10 Found 1 resources for language "en" +16 Executing script invoice-script using http-server strategy +710 Base url not specified, skipping its injection. +723 Replaced assets ["invoice-styles.css","logo.png"] +724 Rendering engine handlebars using http-server strategy +1152 Rendering request 1 finished with error in 1152 ms Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) ```js error.log: ```js 2021-12-06T11:27:35.751Z - error: Rendering request 32 finished with error in 22 ms 2021-12-06T11:27:35.751Z - error: Error when processing render request 32 Unsupported asset encoding param value utf-8, supported values are base64, utf8, link, dataURI and string Error: Unsupported asset encoding param value utf-8, supported values are base64, utf8, link, dataURI and string at convert (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:51:15) at C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:63:26 at C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:718:13 at async.forEachOf.async.eachOf (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:233:13) at _parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:717:9) at Object.async.parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:731:9) at module.exports (C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:71:11) at tryCatcher (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\util.js:16:23) at ret (eval at makeNodePromisifiedEval (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\promisify.js:1:1), <anonymous>:13:39) at evaluateAssets (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:67:24) at Object.<anonymous> (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:391:34) 2021-12-06T11:27:35.752Z - error: Error during processing request at http://localhost:5488/api/report/project-main 2021-12-06T11:28:37.777Z - error: Rendering request 1 finished with error in 849 ms 2021-12-06T11:28:37.778Z - error: Error when processing render request 1 Unsupported asset encoding param value utf-8, supported values are base64, utf8, l ink, dataURI and string Error: Unsupported asset encoding param value utf-8, supported values are base64, utf8, link, dataURI and string at convert (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:51:15) at C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:63:26 at C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:718:13 at async.forEachOf.async.eachOf (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:233:13) at _parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:717:9) at Object.async.parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:731:9) at module.exports (C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:71:11) at tryCatcher (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\util.js:16:23) at ret (eval at makeNodePromisifiedEval (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:13:39) at evaluateAssets (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:67:24) at Object.<anonymous> (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:391:34) 2021-12-06T11:28:37.781Z - error: Error during processing request at http://localhost:5488/api/report/project-main 2021-12-06T11:30:16.170Z - error: Rendering request 2 finished with error in 32 ms 2021-12-06T11:30:16.171Z - error: Error when processing render request 2 Unsupported asset encoding param value utf-8, supported values are base64, utf8, l ink, dataURI and string Error: Unsupported asset encoding param value utf-8, supported values are base64, utf8, link, dataURI and string at convert (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:51:15) at C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:63:26 at C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:718:13 at async.forEachOf.async.eachOf (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:233:13) at _parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:717:9) at Object.async.parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:731:9) at module.exports (C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:71:11) at tryCatcher (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\util.js:16:23) at ret (eval at makeNodePromisifiedEval (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:13:39) at evaluateAssets (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:67:24) at Object.<anonymous> (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:391:34) 2021-12-06T11:30:16.172Z - error: Error during processing request at http://localhost:5488/api/report/project-main 2021-12-06T11:30:18.632Z - error: Rendering request 3 finished with error in 27 ms 2021-12-06T11:30:18.632Z - error: Error when processing render request 3 Unsupported asset encoding param value utf-8, supported values are base64, utf8, l ink, dataURI and string Error: Unsupported asset encoding param value utf-8, supported values are base64, utf8, link, dataURI and string at convert (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:51:15) at C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:63:26 at C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:718:13 at async.forEachOf.async.eachOf (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:233:13) at _parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:717:9) at Object.async.parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:731:9) at module.exports (C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:71:11) at tryCatcher (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\util.js:16:23) at ret (eval at makeNodePromisifiedEval (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:13:39) at evaluateAssets (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:67:24) at Object.<anonymous> (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:391:34) 2021-12-06T11:30:18.632Z - error: Error during processing request at http://localhost:5488/api/report/project-main 2021-12-06T11:31:54.135Z - error: Rendering request 4 finished with error in 24 ms 2021-12-06T11:31:54.136Z - error: Error when processing render request 4 Unsupported asset encoding param value utf-8, supported values are base64, utf8, l ink, dataURI and string Error: Unsupported asset encoding param value utf-8, supported values are base64, utf8, link, dataURI and string at convert (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:51:15) at C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:63:26 at C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:718:13 at async.forEachOf.async.eachOf (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:233:13) at _parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:717:9) at Object.async.parallel (C:\inetpub\wwwroot\jsreportapp\node_modules\async\lib\async.js:731:9) at module.exports (C:\inetpub\wwwroot\jsreportapp\node_modules\async-replace\async-replace.js:71:11) at tryCatcher (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\util.js:16:23) at ret (eval at makeNodePromisifiedEval (C:\inetpub\wwwroot\jsreportapp\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:13:39) at evaluateAssets (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:67:24) at Object.<anonymous> (C:\inetpub\wwwroot\jsreportapp\node_modules\jsreport-assets\lib\assets.js:391:34) 2021-12-06T11:31:54.136Z - error: Error during processing request at http://localhost:5488/api/report/project-main ```js reporter.log: ```js 2021-12-06T11:45:14.355Z - warn: Error during processing request at http://localhost:5488/api/report/invoice-main 2021-12-06T11:46:28.183Z - info: Starting rendering request 19 (user: null) 2021-12-06T11:46:28.184Z - info: Rendering template { name: invoice-main, recipe: chrome-pdf, engine: handlebars, preview: true } 2021-12-06T11:46:29.225Z - warn: Rendering request 19 finished with error in 1041 ms 2021-12-06T11:46:29.225Z - warn: Error when processing render request 19 read ECONNRESET Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) 2021-12-06T11:46:29.225Z - warn: Error during processing request at http://localhost:5488/api/report/invoice-main 2021-12-06T11:46:46.232Z - info: Initializing jsreport@2.11.0 in development mode using configuration file: jsreport.config.json 2021-12-06T11:46:46.235Z - info: Searching for available extensions in C:\inetpub\wwwroot\jsreportapp\ 2021-12-06T11:46:46.259Z - info: Extensions location cache contains up to date information, skipping crawling in C:\inetpub\wwwroot\jsreportapp\ 2021-12-06T11:46:46.296Z - info: Found 35 extensions 2021-12-06T11:46:46.815Z - info: Setting http-server strategy for rendering 2021-12-06T11:46:47.177Z - info: Using extension cli@2.2.5 2021-12-06T11:46:47.188Z - info: Using extension debug@2.1.3 2021-12-06T11:46:47.196Z - info: Using extension express@2.8.1 2021-12-06T11:46:47.535Z - info: Using extension freeze@2.0.0 2021-12-06T11:46:47.539Z - info: Using extension handlebars@2.1.0 2021-12-06T11:46:47.545Z - info: Using extension import-export@2.1.1 2021-12-06T11:46:47.654Z - info: Using extension jsrender@2.1.1 2021-12-06T11:46:47.656Z - info: Using extension tags@2.5.0 2021-12-06T11:46:47.662Z - info: Using extension templates@2.4.0 2021-12-06T11:46:47.667Z - info: Using extension authorization@2.4.0 2021-12-06T11:46:47.677Z - info: Using extension base@2.0.2 2021-12-06T11:46:47.680Z - info: Using extension browser-client@2.2.2 2021-12-06T11:46:47.685Z - info: Using extension child-templates@1.4.0 2021-12-06T11:46:47.696Z - info: Using extension chrome-pdf@1.10.0 2021-12-06T11:46:47.854Z - info: Using extension data@2.4.0 2021-12-06T11:46:47.856Z - info: Using extension docx@2.9.0 2021-12-06T11:46:47.864Z - info: Using extension fs-store@2.9.1 2021-12-06T11:46:48.158Z - info: Using extension licensing@2.2.3 2021-12-06T11:46:48.165Z - info: Using extension pdf-utils@1.10.1 2021-12-06T11:46:48.329Z - info: Using extension pptx@0.7.0 2021-12-06T11:46:48.339Z - info: Using extension reports@2.5.1 2021-12-06T11:46:48.348Z - info: Using extension static-pdf@0.4.0 2021-12-06T11:46:48.356Z - info: Using extension studio@2.10.1 2021-12-06T11:46:48.480Z - info: Using extension text@2.0.0 2021-12-06T11:46:48.482Z - info: Using extension version-control@1.6.0 2021-12-06T11:46:48.669Z - info: Using extension assets@1.7.0 2021-12-06T11:46:48.688Z - info: Using extension html-to-xlsx@2.8.3 2021-12-06T11:46:49.370Z - info: html-to-xlsx detected chrome as available html engine 2021-12-06T11:46:49.370Z - info: Using extension scheduling@2.5.0 2021-12-06T11:46:49.463Z - info: Using extension scripts@2.6.0 2021-12-06T11:46:49.469Z - info: Using extension studio-theme-dark@0.3.0 2021-12-06T11:46:49.471Z - info: Using extension xlsx@2.5.0 2021-12-06T11:46:49.940Z - info: Using extension public-templates@2.2.0 2021-12-06T11:46:49.943Z - info: Using extension resources@2.1.0 2021-12-06T11:46:49.945Z - info: Using extension sample-template@2.6.1 2021-12-06T11:46:49.951Z - info: Using general timeout for rendering (reportTimeout: 60000) 2021-12-06T11:46:49.951Z - info: Using fs provider for template store. 2021-12-06T11:46:49.965Z - info: fs store is persisting using fs 2021-12-06T11:46:49.969Z - info: fs store is synchronizing using fs 2021-12-06T11:46:50.057Z - info: fs store is loading data 2021-12-06T11:46:50.211Z - info: fs store is initialized successfully 2021-12-06T11:46:50.241Z - info: Creating default express app. 2021-12-06T11:46:50.280Z - info: jsreport server successfully started on http port: 5488 2021-12-06T11:46:50.280Z - info: fs store emits sockets to synchronize underlying changes with studio 2021-12-06T11:46:50.322Z - info: Verifying license key DD4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX6FC 2021-12-06T11:46:50.325Z - info: License key for subscription verified against the jsreport.license.json file 2021-12-06T11:46:50.336Z - info: reporter initialized 2021-12-06T11:47:13.750Z - info: Initializing jsreport@2.11.0 in development mode using configuration file: jsreport.config.json 2021-12-06T11:47:13.753Z - info: Searching for available extensions in C:\inetpub\wwwroot\jsreportapp\ 2021-12-06T11:47:13.773Z - info: Extensions location cache contains up to date information, skipping crawling in C:\inetpub\wwwroot\jsreportapp\ 2021-12-06T11:47:13.811Z - info: Found 35 extensions 2021-12-06T11:47:14.328Z - info: Setting http-server strategy for rendering 2021-12-06T11:47:14.690Z - info: Using extension cli@2.2.5 2021-12-06T11:47:14.702Z - info: Using extension debug@2.1.3 2021-12-06T11:47:14.709Z - info: Using extension express@2.8.1 2021-12-06T11:47:15.046Z - info: Using extension freeze@2.0.0 2021-12-06T11:47:15.050Z - info: Using extension handlebars@2.1.0 2021-12-06T11:47:15.056Z - info: Using extension import-export@2.1.1 2021-12-06T11:47:15.168Z - info: Using extension jsrender@2.1.1 2021-12-06T11:47:15.170Z - info: Using extension tags@2.5.0 2021-12-06T11:47:15.176Z - info: Using extension templates@2.4.0 2021-12-06T11:47:15.181Z - info: Using extension authorization@2.4.0 2021-12-06T11:47:15.190Z - info: Using extension base@2.0.2 2021-12-06T11:47:15.193Z - info: Using extension browser-client@2.2.2 2021-12-06T11:47:15.198Z - info: Using extension child-templates@1.4.0 2021-12-06T11:47:15.209Z - info: Using extension chrome-pdf@1.10.0 2021-12-06T11:47:15.368Z - info: Using extension data@2.4.0 2021-12-06T11:47:15.371Z - info: Using extension docx@2.9.0 2021-12-06T11:47:15.379Z - info: Using extension fs-store@2.9.1 2021-12-06T11:47:15.672Z - info: Using extension licensing@2.2.3 2021-12-06T11:47:15.679Z - info: Using extension pdf-utils@1.10.1 2021-12-06T11:47:15.842Z - info: Using extension pptx@0.7.0 2021-12-06T11:47:15.852Z - info: Using extension reports@2.5.1 2021-12-06T11:47:15.860Z - info: Using extension static-pdf@0.4.0 2021-12-06T11:47:15.869Z - info: Using extension studio@2.10.1 2021-12-06T11:47:15.995Z - info: Using extension text@2.0.0 2021-12-06T11:47:15.999Z - info: Using extension version-control@1.6.0 2021-12-06T11:47:16.191Z - info: Using extension assets@1.7.0 2021-12-06T11:47:16.210Z - info: Using extension html-to-xlsx@2.8.3 2021-12-06T11:47:16.895Z - info: html-to-xlsx detected chrome as available html engine 2021-12-06T11:47:16.896Z - info: Using extension scheduling@2.5.0 2021-12-06T11:47:16.991Z - info: Using extension scripts@2.6.0 2021-12-06T11:47:16.997Z - info: Using extension studio-theme-dark@0.3.0 2021-12-06T11:47:16.999Z - info: Using extension xlsx@2.5.0 2021-12-06T11:47:17.355Z - info: Using extension public-templates@2.2.0 2021-12-06T11:47:17.357Z - info: Using extension resources@2.1.0 2021-12-06T11:47:17.359Z - info: Using extension sample-template@2.6.1 2021-12-06T11:47:17.367Z - info: Using general timeout for rendering (reportTimeout: 60000) 2021-12-06T11:47:17.368Z - info: Using fs provider for template store. 2021-12-06T11:47:17.381Z - info: fs store is persisting using fs 2021-12-06T11:47:17.383Z - info: fs store is synchronizing using fs 2021-12-06T11:47:17.429Z - info: fs store is loading data 2021-12-06T11:47:17.581Z - info: fs store is initialized successfully 2021-12-06T11:47:17.612Z - info: Creating default express app. 2021-12-06T11:47:17.658Z - info: jsreport server successfully started on http port: 5488 2021-12-06T11:47:17.659Z - info: fs store emits sockets to synchronize underlying changes with studio 2021-12-06T11:47:17.744Z - info: Verifying license key DD4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX6FC 2021-12-06T11:47:17.748Z - info: License key for subscription verified against the jsreport.license.json file 2021-12-06T11:47:17.762Z - info: reporter initialized 2021-12-06T11:47:21.848Z - info: Starting rendering request 1 (user: null) 2021-12-06T11:47:21.852Z - info: Rendering template { name: invoice-main, recipe: chrome-pdf, engine: handlebars, preview: true } 2021-12-06T11:47:22.932Z - warn: Rendering request 1 finished with error in 1084 ms 2021-12-06T11:47:22.933Z - warn: Error when processing render request 1 read ECONNRESET Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) 2021-12-06T11:47:22.936Z - warn: Error during processing request at http://localhost:5488/api/report/invoice-main 2021-12-06T11:51:04.583Z - info: Starting rendering request 2 (user: null) 2021-12-06T11:51:04.585Z - info: Rendering template { name: timesheet-main, recipe: chrome-pdf, engine: handlebars, preview: false } 2021-12-06T11:51:05.592Z - warn: Rendering request 2 finished with error in 1009 ms 2021-12-06T11:51:05.592Z - warn: Error when processing render request 2 read ECONNRESET Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) 2021-12-06T11:51:05.596Z - warn: Error during processing request at http://localhost:5488/api/report 2021-12-06T11:51:06.243Z - info: Starting rendering request 3 (user: null) 2021-12-06T11:51:06.245Z - info: Rendering template { name: timesheet-main, recipe: chrome-pdf, engine: handlebars, preview: false } 2021-12-06T11:51:09.539Z - info: pdf-utils is starting pdf processing 2021-12-06T11:51:09.869Z - info: Starting rendering request 4 (user: null) 2021-12-06T11:51:09.870Z - info: Rendering template { name: timesheet-header-footer, recipe: chrome-pdf, engine: handlebars, preview: false } 2021-12-06T11:51:10.858Z - info: Rendering request 4 finished in 990 ms 2021-12-06T11:51:10.975Z - info: pdf-utils pdf processing was finished 2021-12-06T11:51:10.976Z - info: Rendering request 3 finished in 4733 ms ```js
-
Thank you.
I believe this error isn't the last one but from somewhere before?
2021-12-06T11:27:35.751Z - error: Error when processing render request 32 Unsupported asset encoding param value utf-8, supported values are base64, utf8, link, dataURI and string Error: Unsupported asset encoding param value utf-8, supported values are base64, utf8, link, dataURI and string
Unfortunately, the output isn't very explaining...
read ECONNRESET logs: +724 Rendering engine handlebars using http-server strategy +1152 Rendering request 1 finished with error in 1152 ms Error: read ECONNRESET
This just says that you are evaluating handlebars and there is a heavy unhandled crash of nodejs process.
Would you be able to email me your workspace so I can import it and take a quick look?
-
I think that the problem is somewhere in the own report. I send data to report to fill the fields. I added the below script to each report to receive this data:
async function beforeRender(req, res) { req.data = Object.assign({}, req.data, { template: req.template, options: req.options }) }
So, in my report, I access those variables as it (example):
<!--{{ setLocale options.language }}--> {{ toUpperCaseFirstLetter $localizedResource.from}} : {{ formatTime startDate @root.options.language }}
where setLocale and toUpperCaseFirstLetter are JS functions defined in the report scripts just below the main report window. That is probably what is caused bug while rendering it from Studio.
The question now is, how can I continue to show my report in Studio while keeping this setup?
Any idea is welcome
-
Maybe you search for this:
async function beforeRender(req, res) { req.options.language = req.options.language || req.template.resources.defaultLanguage || 'en' req.data = Object.assign({}, req.data, { template: req.template, options: req.options }) }
The
req.template.resources.defaultLanguage
is actually something you fill in the studio UI.
-
I try to run reports on my other computer with Windows 10 Pro 64 bits, but with Node 12.14.1 and JSReport 2.6.1. Everything works fine in Studio. I exported those reports and imported them in the server who has problem and got still the same error message. Seem to be a bug with Node and/or JSReport or a missing Node module. I will try to reinstall the same Node and JSReport versions of my other computer.
When you told me to email you my workspace, what do you mean exactly? Is the export reports?
Thanks
-
I reinstalled on my machine NodeJS 12.14.1 Windows 64 bits (exactly what I have on my other machine) and try to install JS Report 2.6.1. But infortunatly, I could really just install the latest release with npm. So I installed JS Report 3.0.0. I both try Studio and my web application with my report and everything works fine. So, it is a bug with Node JS 14.
For the moment, I resolved the problem. Could you tell me where I should open a ticket about this bug? And what do you need to reproduce the bug? If you want, I can email you my reports.
I wait your instructions
Thanks
-
To make it the easiest for us, please compress the whole application folder of the crashing app.
Upload it to some onedrive,dropbox... and send me the link. I would check what's wrong and then you can remove it.