Errors when running puppeteer with docker
See original GitHub issueWhat are you trying to achieve?
I’m trying to run tests in Puppeteer in Docker. May just need to use more docker run
flags or change something in the codeceptjs.json
.
What do you get instead?
Here is the repo with my setup for reproducing the error.
From within that repo I run
docker run --net=host -v /Code/codecept-test:/tests codeception/codeceptjs
Which uses the codeception/codeceptjs
docker image with ID 5bbce4c27fdb
and I get the following error
CodeceptJS directory has been found.
CodeceptJS v1.1.7
Using test root "/tests"
My first test file @feature_set_1 --
✖ "before each" hook: codeceptjs.before for "test something @one @example" in 47ms
Error: Failed to launch chrome!
[0411/155101.763032:ERROR:zygote_host_impl_linux.cc(88)] 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
(node:24) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!
[0411/155101.763032:ERROR:zygote_host_impl_linux.cc(88)] 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
(node:24) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
-- FAILURES:
1) My first test file @feature_set_1
"before each" hook: codeceptjs.before for "test something @one @example":
Failed to launch chrome!
[0411/155101.763032:ERROR:zygote_host_impl_linux.cc(88)] 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
Run with --verbose flag to see NodeJS stacktrace
FAIL | 0 passed, 1 failed // 58ms
Details
From within the docker image I pulled the following
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:5
Top Results From Across the Web
puppeteer/troubleshooting.md at main
Getting headless Chrome up and running in Docker can be tricky. The bundled Chromium that Puppeteer installs is missing the necessary shared library ......
Read more >After using Docker in my puppeteer project it is not working. ...
I have just used the following codes and it works, FROM node:14.5.0 WORKDIR /app # Install latest chrome dev package and fonts to...
Read more >ERROR: Cannot read property 'split' of undefined (Docker ...
Hi, When i run the below code on my local N8N (npm installed) in function ... read property 'split' of undefined (Docker N8N...
Read more >Puppeteer in alpine docker with chromium headless ...
Also I tried firefox in headless mode for grabbing screenshot, that too throws error... *** You are running in headless mode. Crash Annotation ......
Read more >How to use Puppeteer inside a Docker container
Introduction Puppeteer is a Node.js library which provides a high-level ... When I run this same docker file I receive the following error:....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I updated the helper section of my codecept config to pass the
--no-sandbox
arg and it seemed to work. What does this do and why is it required?Using the
node:14
helped me to fix these problems.