I can confirm that it just a docker & m1 & chrome-pdf/puppeteer (combination problem only). I have docker & m1 & mongo working fine. BTW running it on normal jsreport code (nodejs) & M1 works fine with me.
Let see how the docker/chrome M1 progress
I can confirm that it just a docker & m1 & chrome-pdf/puppeteer (combination problem only). I have docker & m1 & mongo working fine. BTW running it on normal jsreport code (nodejs) & M1 works fine with me.
Let see how the docker/chrome M1 progress
Im using docker desktop in my Apple Macbook Pro with M1 aka Apple Silicon, and uses the docker image jsreport/jsreport:2.11.0-full and it does not work
Here is the error that I got from when ever i used Chrome PDF as recipe. Take note that I'm using the sample data so there should be no problem with the template itself.
After a quick Google, I saw this https://github.com/puppeteer/puppeteer/issues/6258, and https://github.com/puppeteer/puppeteer/issues/6622.
Yep it works.. thanks, these needs a blog or recipe entry please
I reviewed the the playground sample at https://playground.jsreport.net/w/admin/Wy6stA8t about the merging and header and footer and pdf-utils
about the pdfCreatePagesGroup
, but i cannot determine how to get the page number of subgroups. Let say I have templates like this
{{#each students}}
<h1 style='page-break-before: always'>{{name}}</h1>
{{{pdfCreatePagesGroup name}}}
<div>lots of other content expanding to multiple pages</div>
....
{{/each}}
And as you can see single student spans multiple page, so i want a paging like Student "James Doe" - Page 1 of 3
, then Student "Anna Capri" - Page 1 of 3
It's a total of 6 pages, but I want the paging respects the paging of groups.
According to article https://jsreport.net/learn/configuration
"If you want to use environment variable for configuring a complex object you should separate the nested path in the key using _", but if you are using nodejs 10+, and the name of configuration is extension_mongo-store_uri, if there is a dash on the name, just like the mongo-store, it will not work. It works on plain nodejs on my dev machine though, so i dont know if its a node, docker or jsReport problem. Can we get the setting name NOT to have dash on it?
After some thought, the jsReportClient is really the issue here. Actually there is a setting jsRepoClient that i overlooked, https://jsreport.net/learn/nodejs-client
at the bottom of the article named "Handling request timeout".
So my issue is resolved here, and it can be tagged as resolve if necessary
I notice that when ever the report was rendered less than 5 seconds, the report show on my app, but if it more than that, my app fails to get it. I read this https://jsreport.net/blog/long-reports and implement the settings for chome-pdf, but still i got the issue after update the config. By the way i was using the jsreport/jsreport:2.5.0
from docker hub
extensions_authentication_admin_username=admin
extensions_authentication_admin_password=guessmeifyoucan
extensions_authentication_cookieSession_secret=long-secret
extensions_express_renderTimeout=600000
extensions_mongodb-store_uri=<intentionally-remove-but-i-can-confirm-that-this-works>
extensions_mongodb-store_prefix=jsreport_
templatingEngines_timeout=600000
templatingEngines_strategy=http-server
templatingEngines_numberOfWorkers=4
chrome_timeout=600000
store_provider=mongodb
Here is the environment variables that i setup, i can confirm that this is being used because when-ever i change a value that this not valid, jsreport throws error (e.g. i change the store_provider=not-exists)
2019-07-15T16:09:03.194808568Z 2019-07-15T16:09:03.194Z - info: Rendering template { name: /sf9/template-inside, recipe: chrome-pdf, engine: handlebars, preview: false }
2019-07-15T16:09:06.884946962Z 2019-07-15T16:09:06.884Z - info: Rendering request 3 finished in 5469 ms
2019-07-15T16:09:08.278518458Z 2019-07-15T16:09:08.278Z - info: Rendering request 4 finished in 5102 ms
And here is the error i got from my app
2019-07-15T15:37:22.476205646Z Error: ESOCKETTIMEDOUT
2019-07-15T15:37:22.476238940Z at ClientRequest.<anonymous> (/usr/src/app/node_modules/request/request.js:816:19)
2019-07-15T15:37:22.476251835Z at Object.onceWrapper (events.js:313:30)
2019-07-15T15:37:22.476259179Z at emitNone (events.js:106:13)
2019-07-15T15:37:22.476265953Z at ClientRequest.emit (events.js:208:7)
2019-07-15T15:37:22.476272457Z at TLSSocket.emitTimeout (_http_client.js:711:34)
2019-07-15T15:37:22.476278983Z at Object.onceWrapper (events.js:313:30)
2019-07-15T15:37:22.476285919Z at emitNone (events.js:106:13)
2019-07-15T15:37:22.476292279Z at TLSSocket.emit (events.js:208:7)
2019-07-15T15:37:22.476298806Z at TLSSocket.Socket._onTimeout (net.js:420:8)
2019-07-15T15:37:22.476305433Z at ontimeout (timers.js:482:11)
2019-07-15T15:37:22.476311855Z at tryOnTimeout (timers.js:317:5)
2019-07-15T15:37:22.476318321Z at Timer.listOnTimeout (timers.js:277:5)
2019-07-15T15:37:23.977099750Z Error: ESOCKETTIMEDOUT
2019-07-15T15:37:23.977116871Z at ClientRequest.<anonymous> (/usr/src/app/node_modules/request/request.js:816:19)
2019-07-15T15:37:23.977122485Z at Object.onceWrapper (events.js:313:30)
2019-07-15T15:37:23.977145631Z at emitNone (events.js:106:13)
2019-07-15T15:37:23.977151173Z at ClientRequest.emit (events.js:208:7)
2019-07-15T15:37:23.977155052Z at TLSSocket.emitTimeout (_http_client.js:711:34)
2019-07-15T15:37:23.977159157Z at Object.onceWrapper (events.js:313:30)
2019-07-15T15:37:23.977163150Z at emitNone (events.js:106:13)
2019-07-15T15:37:23.977167159Z at TLSSocket.emit (events.js:208:7)
2019-07-15T15:37:23.977171136Z at TLSSocket.Socket._onTimeout (net.js:420:8)
2019-07-15T15:37:23.977175056Z at ontimeout (timers.js:482:11)
2019-07-15T15:37:23.977178857Z at tryOnTimeout (timers.js:317:5)
2019-07-15T15:37:23.977182694Z at Timer.listOnTimeout (timers.js:277:5)
2019-07-15T16:09:06.415014279Z Error: ESOCKETTIMEDOUT
2019-07-15T16:09:06.415065000Z at ClientRequest.<anonymous> (/usr/src/app/node_modules/request/request.js:816:19)
2019-07-15T16:09:06.415089507Z at Object.onceWrapper (events.js:313:30)
2019-07-15T16:09:06.415096213Z at emitNone (events.js:106:13)
2019-07-15T16:09:06.415103372Z at ClientRequest.emit (events.js:208:7)
2019-07-15T16:09:06.415125578Z at TLSSocket.emitTimeout (_http_client.js:711:34)
2019-07-15T16:09:06.415131636Z at Object.onceWrapper (events.js:313:30)
2019-07-15T16:09:06.415136942Z at emitNone (events.js:106:13)
2019-07-15T16:09:06.415142341Z at TLSSocket.emit (events.js:208:7)
2019-07-15T16:09:06.415147655Z at TLSSocket.Socket._onTimeout (net.js:420:8)
2019-07-15T16:09:06.415153067Z at ontimeout (timers.js:482:11)
2019-07-15T16:09:06.415158331Z at tryOnTimeout (timers.js:317:5)
2019-07-15T16:09:06.415163762Z at Timer.listOnTimeout (timers.js:277:5)
2019-07-15T16:09:08.167171181Z Error: ESOCKETTIMEDOUT
2019-07-15T16:09:08.167225891Z at ClientRequest.<anonymous> (/usr/src/app/node_modules/request/request.js:816:19)
2019-07-15T16:09:08.167234873Z at Object.onceWrapper (events.js:313:30)
2019-07-15T16:09:08.167240033Z at emitNone (events.js:106:13)
2019-07-15T16:09:08.167245554Z at ClientRequest.emit (events.js:208:7)
2019-07-15T16:09:08.167250776Z at TLSSocket.emitTimeout (_http_client.js:711:34)
2019-07-15T16:09:08.167255899Z at Object.onceWrapper (events.js:313:30)
2019-07-15T16:09:08.167261152Z at emitNone (events.js:106:13)
2019-07-15T16:09:08.167266695Z at TLSSocket.emit (events.js:208:7)
2019-07-15T16:09:08.167283463Z at TLSSocket.Socket._onTimeout (net.js:420:8)
2019-07-15T16:09:08.167290010Z at ontimeout (timers.js:482:11)
2019-07-15T16:09:08.167295509Z at tryOnTimeout (timers.js:317:5)
2019-07-15T16:09:08.167300834Z at Timer.listOnTimeout (timers.js:277:5)
As you can see from here, it was throwing sockettime-out. from the request module, I did not use the request npm module but rather i used the "jsreport-client": "^1.0.2",
, i'm not sure (but most probably jsreport client is using it). I used js-report client for getting the report.
ow.. the document of jsreport-mongodb-store, updates in relation to it.. good job.