Skip to content

Errors when running puppeteer with docker #1022

Closed

Description

@wburningham

What 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

  • CodeceptJS version: v1.1.7
  • NodeJS Version: v8.9.1
  • Operating System: uname -a provides Linux linuxkit-025000000001 4.9.75-linuxkit-aufs #1 SMP Tue Jan 9 10:58:17 UTC 2018 x86_64 GNU/Linux
  • Puppeteer version: whatever is install in the docker image
  • Configuration file: link
  • Suite config: link

Activity

  1. wburningham commented on Apr 25, 2018

    @wburningham
    Author

    I did a docker pull on the codeception/codeceptjs image and got id f976668debef The same error still occurs.

    Any advice?

  2. wburningham commented on Apr 27, 2018

    @wburningham
    Author

    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?

    "helpers": {
        "Puppeteer": {
          "chrome":{
            "args": ["--no-sandbox"]
          }
        }
      },
    
  3. M4zD4i commented on Apr 27, 2018

    @M4zD4i

    I have the same issue with ImgID f976668debef. At this time used the same fix into config

  4. mralexho commented on Sep 24, 2018

    @mralexho
  5. iamdempa commented on Jan 6, 2021

    @iamdempa

    Using the node:14 helped me to fix these problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions