Cannot `yarn "install` inside container because of protocal-types-generator
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: master (084cf021195dbe125d26496796f590a4300fb844)
- Platform / OS version: Docker container running
node:8
- Node.js version: 8.16
What steps will reproduce the problem?
git clone https://github.com/GoogleChrome/puppeteer.git
yarn
(npm
fails the same way)
What is the expected result? Puppeteer is installed.
What happens instead?
Installation fails when running the install script node install.js
because the protocol-types-generation tries to launch chrome without the --no-sandbox
argument.
Here is the output:
root@494abee07b90:/app# yarn
yarn install v1.15.2
info No lockfile found.
[1/4] Resolving packages...
warning parcel > htmlnano > uncss > jsdom > left-pad@1.3.0: use String.prototype.padStart()
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/4] ⢀ waiting...
[4/4] ⢀ parcel
[3/4] ⢀ puppeteer
error /app/node_modules/puppeteer: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /app/node_modules/puppeteer
Output:
Chromium downloaded to /app/node_modules/puppeteer/.local-chromium/linux-641577
ERROR: Failed to download Chromium r641577! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Error: Failed to launch chrome!
[0528/160658.820235:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
at onClose (/app/node_modules/puppeteer/lib/Launcher.js:342:14)
at Interface.helper.addEventListener (/app/node_modules/puppeteer/lib/Launcher.js:331:50)
at emitNone (events.js:111:20)
at Interface.emit (events.js:208:7)
at Interface.close (readline.js:368:8)
at Socket.onend (readline.js:147:10)
at emitNone (events.js:111:20)
at Socket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
The “Fail to launch Chrome” error is misleading as the .catch
handler (here also catches error from function invocation in the onSuccess
handler.
The error is actually thrown by onSuccess > generateProtocolTypesIfNecessary > utils/protocol-types-generator/index.js
; because it launches chrome without the --no-sandbox
argument and this fails within a container because of root shenanigans.
note: I’ve also tried using the recommended Dockerfile, but it yields the same results.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
No puppeteer is installed via yarn (I guess yarn/npm doesn’t make a difference here but I may be wrong). You can see that it’s installed via the npm registry in the Dockerfile I pasted above.Wrong.I think I understand what the issue is now, I’ve been using my “fork” (while #1215 is pending) referenced in my package.json like so:
"puppeteer": "https://github.com/pyrho/puppeteer#27bc6663e5b72b1acb0c30c8856fdb39a56e433b"
, so that’s why it’s trying to generate the protocol types I guess, because I’m not pulling the prebuilt package from the NPM registry.Sorry for the noise, and thank you for your patience and your hard work on puppeteer!
@pyrho based on this your comment and your description here, do I understand it correctly that you install Puppeteer from github rather than from npm?