Chromium revision not downloaded
-
Hello there, we have been using the docker image for jsreport 2.5 in a docker container with electron-pdf and now want to have this work with chrome-pdf instead. I think we have updated our
jsreport.config.json
accordingly but have run into the following issue after the change:
Error: Chromium revision is not downloaded. Run "npm install" or "yarn install" at Launcher.launch (/app/node_modules/puppeteer/lib/Launcher.js:119:15) at <anonymous>
Here is what the
jsreport.config.json
looks like:"certificate": { "key": "*****", "cert": "*****" }, "authentication": { "cookieSession": { "secret": "*****" }, "admin": { "username": "*****", "password": "*****" }, "enabled": false }, "store": { "provider": "fs", "timeout": 1800000 }, "httpPort": 5488, "httpsPort": null, "logger": { "console": { "transport": "console", "level": "debug" }, "file": { "transport": "file", "level": "debug", "filename": "logs/reporter.log" }, "error": { "transport": "file", "level": "error", "filename": "logs/error.log" } }, "blobStorage": { "provider": "fs", "timeout": 1800000 }, "phantom": { "strategy": "dedicated-process", "timeout": 1800000 }, "templatingEngines": { "strategy": "dedicated-process", "forkOptions": { "execArgv": ["--max-old-space-size=4096"] }, "numberOfWorkers": 8, "timeout": 1800000, "allowedModules": "*" }, "extensions": { "chrome-pdf": { "timeout": 1800000, "strategy": "chrome-pool", "numberOfWorkers": 8, "launchOptions": { "args": ["--pipe=true", "--no-sandbox"] } }, "fs-store": { "timeout": 1800000 }, "scripts": { "allowedModules": "*", "timeout": 1800000 }, "express": { "inputRequestLimit": "200mb" } }, "assets": { "publicAccessEnabled": true } }
And here is the container's corresponding Dockerfile:
FROM jsreport/jsreport:2.5.0-full # Create the directory service group and user ## --gid 500 and "apps" correspond with same gid and group name as are used by the directory service RUN addgroup --system --gid 500 apps ## --disabled-password does not mean you cannot log in via ssh for instance ## --gecos "" -- makes adduser run non-interactively ## -u 1051 and "directorygenerator" corresponds with same uid and username as are used by the directory service RUN adduser --system --shell /bin/bash -u 1051 --gid 500 directorygenerator RUN chown -R directorygenerator:apps /app # Switch to the restricted user # USER directorygenerator # copy the configuration to the jsreport image COPY jsreport.config.json /app COPY /data /app/data # expose port 5488, technically done in base image, but here for visibility EXPOSE 5488
This particular container builds the jsreport image that is used by another service of ours which, when running, shows that Chromium revision error. I have inspected the docker container and found that the in the puppeteer module, there was no chromium-related package to be found anywhere. Any help with this issue would be appreciated.Thanks!
-
Chrome in docker requires extra installation. Check what we do in the base image
https://github.com/jsreport/jsreport/blob/master/docker/full/DockerfileTheoretically, it could work as you have it, but maybe there is a problem with merging config
ENV chrome_launchOptions_executablePath google-chrome-stable
Try to check if this env is set in the container. If not, try to set it in your config.
-
Thank you @jan_blaha for the suggestions. I did not see that env in my docker container so I set it in my config along with adding the launchOption arg: "--disable-dev-shm-usage", that is specified in the base image Dockerfile you posted. This did resolve my Chromium revision download error, but when I tried to render a PDF after running my service, then this new error occurred:
Error: Navigation failed because browser has disconnected! at CDPSession.LifecycleWatcher._eventListeners.helper.addEventListener (/app/node_modules/puppeteer/lib/LifecycleWatcher.js:46:107) at emitNone (events.js:106:13) at CDPSession.emit (events.js:208:7) at CDPSession._onClosed (/app/node_modules/puppeteer/lib/Connection.js:215:10) at Connection._onClose (/app/node_modules/puppeteer/lib/Connection.js:138:15) at WebSocketTransport._ws.addEventListener.event (/app/node_modules/puppeteer/lib/WebSocketTransport.js:45:22) at WebSocket.onClose (/app/node_modules/puppeteer/node_modules/ws/lib/event-target.js:124:16) at emitTwo (events.js:126:13) at WebSocket.emit (events.js:214:7) at WebSocket.emitClose (/app/node_modules/puppeteer/node_modules/ws/lib/websocket.js:191:10) at Socket.socketOnClose (/app/node_modules/puppeteer/node_modules/ws/lib/websocket.js:850:15) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at TCP._handle.close [as _onclose] (net.js:561:12) -- ASYNC -- at Frame.<anonymous> (/app/node_modules/puppeteer/lib/helper.js:110:27) at Page.goto (/app/node_modules/puppeteer/lib/Page.js:629:49) at Page.<anonymous> (/app/node_modules/puppeteer/lib/helper.js:111:23) at runWithTimeout (/app/node_modules/jsreport-chrome-pdf/lib/conversion.js:43:16) at <anonymous> at process._tickDomainCallback (internal/process/next_tick.js:229:7)
I searched for a way to resolve this by testing changes in my Dockerfile and changing the launchOption args with no luck. My current config json looks like this:
"certificate": { "key": "*****", "cert": "*****" }, "authentication": { "cookieSession": { "secret": "*****" }, "admin": { "username": "*****", "password": "*****" }, "enabled": false }, "store": { "provider": "fs", "timeout": 1800000 }, "httpPort": 5488, "httpsPort": null, "logger": { "console": { "transport": "console", "level": "debug" }, "file": { "transport": "file", "level": "debug", "filename": "logs/reporter.log" }, "error": { "transport": "file", "level": "error", "filename": "logs/error.log" } }, "blobStorage": { "provider": "fs", "timeout": 1800000 }, "phantom": { "strategy": "dedicated-process", "timeout": 1800000 }, "templatingEngines": { "strategy": "dedicated-process", "forkOptions": { "execArgv": ["--max-old-space-size=4096"] }, "numberOfWorkers": 8, "timeout": 1800000, "allowedModules": "*" }, "extensions": { "chrome-pdf": { "numberOfWorkers": 8, "timeout": 1800000, "allowLocalFilesAccess": true, "launchOptions": { "args": ["--pipe=true","--no-sandbox","--disable-dev-shm-usage"], "executablePath": "google-chrome-stable" } }, "fs-store": { "timeout": 1800000 }, "scripts": { "allowedModules": "*", "timeout": 1800000 }, "express": { "inputRequestLimit": "100mb" } }, "assets": { "publicAccessEnabled": true } }
Again, I'm not sure where to go with this so any ideas would be appreciated. Thanks!
-
Does it fail also for a hello world template? It can be an error specific to your template.
-
I have not, but will try that. I will also check through my template for any other possible clues. Does that error message generally pertain to a template issue?
-
Hi all.
I Have the same issue.
@jan_blaha, I created simple template and it works but when I exported a template from Playground and imported into my server the same error occurs as @ajphillips reported.
The template I imported is: https://playground.jsreport.net/w/admin/cBFKE3RY
It works at the Playground so I assume the problem is not in the template but in the server settings.
Could you assist please?
-
@sham6215 The "Chromium revision not downloaded" error signals jsreport wasn't properly installed. Please open a new thread and fully describe step by step how you installed jsreport, what OS you use and how your configuration looks like.
-
@jan_blaha, thenk you for the reply.
I installed the server from docker image:
dockerfile jsreport/jsreport:2.5.0-full
Is it enough for jsreport running or should we use manual setup?
-
the official docker image should run just fine without anything else needed
docker run -p 5488:5488 jsreport/jsreport:2.5.0-full
In case you are building your own custom image, follow this doc
https://jsreport.net/learn/customize-docker-image
-
@jan_blaha I did installation from the docker file like you suggested but the error still exists.
Will try to set up manually and write result after that.
Thanks for your kind answer.
-
Following up on @ajphillips initial issue, I had a comparable issue when building my own docker container from the published base container and was able to resolve the issue by removing the
--no-sandbox
argument for chrome-pdf. In my case, I had copied that over from my local install, and did not actually require the argument when building from the base image. Hope this helps anyone else that may be in the same situation.