chrome-pdf render error on container
-
Hi,
I'm using a customized jsreport dockerfile, to run jsreport on a container. When it renders a chrome-pdf template, it fails with the following error:report-jsreport-1 | 2022-09-08T13:25:17.301Z - debug: Executing recipe chrome-pdf rootId=aa5o7c991gyrzgz, id=aa5o7c991gyrzgz report-jsreport-1 | 2022-09-08T13:25:17.338Z - error: Error when processing render request 1 Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (950341). Error: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (950341). report-jsreport-1 | at ChromeLauncher.launch (/var/lib/nimbus-report-template/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:109:27) report-jsreport-1 | at async createBrowser (/var/lib/nimbus-report-template/node_modules/@jsreport/jsreport-chrome-pdf/lib/chromePoolStrategy.js:98:26) report-jsreport-1 | at async allocateBrowser (/var/lib/nimbus-report-template/node_modules/@jsreport/jsreport-chrome-pdf/lib/chromePoolStrategy.js:113:5) report-jsreport-1 | at async getBrowser (/var/lib/nimbus-report-template/node_modules/@jsreport/jsreport-chrome-pdf/lib/chromePoolStrategy.js:23:30) report-jsreport-1 | at async module.exports (/var/lib/nimbus-report-template/node_modules/@jsreport/jsreport-chrome-pdf/lib/conversion.js:11:19) report-jsreport-1 | at async execute (/var/lib/nimbus-report-template/node_modules/@jsreport/jsreport-chrome-pdf/lib/chromePoolStrategy.js:20:22) report-jsreport-1 | at async /var/lib/nimbus-report-template/node_modules/@jsreport/jsreport-chrome-pdf/lib/lazyRecipe.js:62:20 report-jsreport-1 | at async invokeRender (/var/lib/nimbus-report-template/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:95:5) report-jsreport-1 | at async WorkerReporter._render (/var/lib/nimbus-report-template/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:147:7) report-jsreport-1 | at async /var/lib/nimbus-report-template/node_modules/@jsreport/jsreport-core/lib/worker/reporter.js:179:19 rootId=aa5o7c991gyrzgz, id=aa5o7c991gyrzgz report-jsreport-1 | 2022-09-08T13:25:17.347Z - error: Rendering request 1 finished with error in 4358 ms rootId=aa5o7c991gyrzgz, id=aa5o7c991gyrzgz report-jsreport-1 | 2022-09-08T13:25:17.362Z - info: Async report render finished with error undefined
I'm using the following dockerfile:
FROM jsreport/jsreport:3.7.1-full AS builder-image WORKDIR /var/lib/nimbus-report-template COPY src ./src COPY package*.json ./ COPY .npmrc ./ COPY jsreport.config.json ./ RUN npm i RUN npm install -g rimraf FROM jsreport/jsreport:3.7.1-full AS runtime-image WORKDIR /var/lib/nimbus-report-template COPY --from=builder-image ./var/lib/nimbus-report-template . CMD npm start
and set the extension config:
"chrome": { "timeout": 36000 }, "extensions": { "chrome-pdf": { "timeout": 36000, "launchOptions": { "timeout": 36000, "args": ["--no-sandbox"] } },
Thanks.
-
Can you find the chrome binary inside the image here? Looks like it got lost somewhere during your install/copy.