Cypress: Cypress verify command failing

Created on 17 Jan 2020  Â·  15Comments  Â·  Source: cypress-io/cypress

Current behavior:

After an apt update of ubuntu 18.04 (yesterday 16/01/2020), the following cypress command return an error.
npx cypress verify

It looks like this is your first time using Cypress: 3.8.2

✖ Verifying Cypress can run /root/.cache/Cypress/3.8.2/Cypress
→ Cypress Version: 3.8.2
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.


Command failed: /root/.cache/Cypress/3.8.2/Cypress/Cypress --no-sandbox --smoke-test --ping=24


Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.8.2

/root/.cache/Cypress/3.8.2/Cypress/Cypress --no-sandbox --smoke-test --ping=24

(Cypress:20915): Gtk-WARNING **: 12:20:46.593: cannot open display:

Desired behavior:

cypress verify should pass

Test code to reproduce

Versions

Ubuntu Linux - 18.04
Cypress Version: 3.8.2

Packages Versions :

apt-get install libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

libgtk2.0-0 is already the newest version (2.24.32-1ubuntu1).
libnotify-dev is already the newest version (0.7.7-3).
libxss1 is already the newest version (1:1.2.2-1).
libxtst6 is already the newest version (2:1.2.3-1).
xauth is already the newest version (1:1.0.10-1).
libgconf-2-4 is already the newest version (3.2.6-4ubuntu1).
libasound2 is already the newest version (1.1.3-5ubuntu0.2).
libgtk-3-0 is already the newest version (3.22.30-1ubuntu4).
libnss3 is already the newest version (2:3.35-2ubuntu2.7).
xvfb is already the newest version (2:1.19.6-1ubuntu4.3).

existing workaround bug

Most helpful comment

Got the source of the problem, Xvfb is run without -screen so electron dies with:

Received signal 11 SEGV_MAPERR ffffef7352286c69
#0 0x56379509d3d9 (/root/.cache/Cypress/3.8.2/Cypress/Cypress+0x35d13d8)
r8: 0000000000000000  r9: 00007ffe15194500 r10: 00007ffe15194458 r11: 000000000000000e
r12: 00007ffe151945ac r13: 00007f595336d720 r14: ffffef7352286c39 r15: 00007f5954966200
di: 0000000000000000  si: 0000000000000020  bp: 0000000000000000  bx: 0000108e1c720e70
dx: 0000000000000001  ax: 0000000000000030  cx: 0000000000000001  sp: 00007ffe15194580
ip: 00007f595494a2dd efl: 0000000000010246 cgf: 002b000000000033 erf: 0000000000000005
trp: 000000000000000e msk: 0000000000000000 cr2: ffffef7352286c69
[end of stack trace]
Calling _exit(1). Core file will not be generated.

If is set fallback this._xvfb_args = options.xvfb_args || [ '-screen', '0', '1024x768x24' ] at @cypress/xvfb it looks like everything works.

All 15 comments

We are experiencing the same error. We had a docker container working yesterday, rebuild the docker today, so newer versions installed through apt and now it's broken with the same error described above.

I've got a docker image before it was broken. If I run the following command

cypress run --config-file ./cypress/cypress.json
Cypress could not verify that this server is running:

  > http://localhost:8080/

you can see cypress starts and correctly waits for something that's not running.
If I do an apt update and apt upgrade with the following output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libllvm8
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
  libllvm9
The following packages will be upgraded:
  apt base-files bash bsdutils bzip2 debconf dpkg dumb-init e2fsprogs fdisk gcc-8-base grep java-common libapt-pkg5.0 libblkid1
  libbz2-1.0 libcom-err2 libdb5.3 libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libexpat1
  libext2fs2 libfdisk1 libgcc1 libgcrypt20 libgl1-mesa-dri libglapi-mesa libglx-mesa0 libgnutls30 libidn2-0 libldap-2.4-2
  libldap-common libmount1 libpam-modules libpam-modules-bin libpam-runtime libpam0g libprocps6 libsmartcols1 libsqlite3-0 libss2
  libstdc++6 libsystemd0 libudev1 libunistring2 libuuid1 libx11-data libzstd1 login mount passwd util-linux zulu-8
57 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 142 MB of archives.
Preparing to unpack .../02-libsqlite3-0_3.22.0-1ubuntu0.2_amd64.deb ...
Unpacking libsqlite3-0:amd64 (3.22.0-1ubuntu0.2) over (3.22.0-1) ...
Preparing to unpack .../03-libdrm-common_2.4.99-1ubuntu1~18.04.1_all.deb ...
Unpacking libdrm-common (2.4.99-1ubuntu1~18.04.1) over (2.4.97-1ubuntu1~18.04.1) ...
Preparing to unpack .../04-libdrm2_2.4.99-1ubuntu1~18.04.1_amd64.deb ...
Unpacking libdrm2:amd64 (2.4.99-1ubuntu1~18.04.1) over (2.4.97-1ubuntu1~18.04.1) ...
Preparing to unpack .../05-libx11-data_2%3a1.6.4-3ubuntu0.2_all.deb ...
Unpacking libx11-data (2:1.6.4-3ubuntu0.2) over (2:1.6.4-3ubuntu0.1) ...
Preparing to unpack .../06-java-common_0.68ubuntu1~18.04.1_all.deb ...
Unpacking java-common (0.68ubuntu1~18.04.1) over (0.63ubuntu1~02) ...
Preparing to unpack .../07-libdrm-amdgpu1_2.4.99-1ubuntu1~18.04.1_amd64.deb ...
Unpacking libdrm-amdgpu1:amd64 (2.4.99-1ubuntu1~18.04.1) over (2.4.97-1ubuntu1~18.04.1) ...
Preparing to unpack .../08-libdrm-intel1_2.4.99-1ubuntu1~18.04.1_amd64.deb ...
Unpacking libdrm-intel1:amd64 (2.4.99-1ubuntu1~18.04.1) over (2.4.97-1ubuntu1~18.04.1) ...
Preparing to unpack .../09-libdrm-nouveau2_2.4.99-1ubuntu1~18.04.1_amd64.deb ...
Unpacking libdrm-nouveau2:amd64 (2.4.99-1ubuntu1~18.04.1) over (2.4.97-1ubuntu1~18.04.1) ...
Preparing to unpack .../10-libdrm-radeon1_2.4.99-1ubuntu1~18.04.1_amd64.deb ...
Unpacking libdrm-radeon1:amd64 (2.4.99-1ubuntu1~18.04.1) over (2.4.97-1ubuntu1~18.04.1) ...
Preparing to unpack .../11-libglx-mesa0_19.2.1-1ubuntu1~18.04.1_amd64.deb ...
Unpacking libglx-mesa0:amd64 (19.2.1-1ubuntu1~18.04.1) over (19.0.8-0ubuntu0~18.04.3) ...
Preparing to unpack .../12-libglapi-mesa_19.2.1-1ubuntu1~18.04.1_amd64.deb ...
Unpacking libglapi-mesa:amd64 (19.2.1-1ubuntu1~18.04.1) over (19.0.8-0ubuntu0~18.04.3) ...
Selecting previously unselected package libllvm9:amd64.
Preparing to unpack .../13-libllvm9_1%3a9-2~ubuntu18.04.1_amd64.deb ...
Unpacking libllvm9:amd64 (1:9-2~ubuntu18.04.1) ...
Preparing to unpack .../14-libgl1-mesa-dri_19.2.1-1ubuntu1~18.04.1_amd64.deb ...
Unpacking libgl1-mesa-dri:amd64 (19.2.1-1ubuntu1~18.04.1) over (19.0.8-0ubuntu0~18.04.3) ...
Preparing to unpack .../15-libldap-common_2.4.45+dfsg-1ubuntu1.4_all.deb ...
Unpacking libldap-common (2.4.45+dfsg-1ubuntu1.4) over (2.4.45+dfsg-1ubuntu1.1) ...
Preparing to unpack .../16-libldap-2.4-2_2.4.45+dfsg-1ubuntu1.4_amd64.deb ...
Unpacking libldap-2.4-2:amd64 (2.4.45+dfsg-1ubuntu1.4) over (2.4.45+dfsg-1ubuntu1.1) ...
Preparing to unpack .../17-dumb-init_1.2.1-1_amd64.deb ...
Unpacking dumb-init (1.2.1-1) over (1.1.3) ...
Preparing to unpack .../18-zulu-8_8.44.0.9_amd64.deb ...
Unpacking zulu-8 (8.44.0.9) over (8.36.0.1) ...
Setting up libexpat1:amd64 (2.2.5-3ubuntu0.2) ...
Setting up libldap-common (2.4.45+dfsg-1ubuntu1.4) ...
Setting up mount (2.31.1-0.4ubuntu3.4) ...
Setting up java-common (0.68ubuntu1~18.04.1) ...
Setting up libglapi-mesa:amd64 (19.2.1-1ubuntu1~18.04.1) ...
Setting up libprocps6:amd64 (2:3.3.12-3ubuntu1.2) ...
Setting up bzip2 (1.0.6-8.1ubuntu0.2) ...
Setting up libdrm-common (2.4.99-1ubuntu1~18.04.1) ...
Setting up libldap-2.4-2:amd64 (2.4.45+dfsg-1ubuntu1.4) ...
Setting up zulu-8 (8.44.0.9) ...
update-alternatives: using /usr/lib/jvm/zulu-8-amd64/bin/clhsdb to provide /usr/bin/clhsdb (clhsdb) in auto mode
update-alternatives: using /usr/lib/jvm/zulu-8-amd64/bin/hsdb to provide /usr/bin/hsdb (hsdb) in auto mode
update-alternatives: using /usr/lib/jvm/zulu-8-amd64/bin/jfr to provide /usr/bin/jfr (jfr) in auto mode
Setting up libsqlite3-0:amd64 (3.22.0-1ubuntu0.2) ...
Setting up dumb-init (1.2.1-1) ...
Setting up libllvm9:amd64 (1:9-2~ubuntu18.04.1) ...
Setting up libx11-data (2:1.6.4-3ubuntu0.2) ...
Setting up libdrm2:amd64 (2.4.99-1ubuntu1~18.04.1) ...
Setting up libdrm-intel1:amd64 (2.4.99-1ubuntu1~18.04.1) ...
Setting up libdrm-radeon1:amd64 (2.4.99-1ubuntu1~18.04.1) ...
Setting up libdrm-nouveau2:amd64 (2.4.99-1ubuntu1~18.04.1) ...
Setting up libdrm-amdgpu1:amd64 (2.4.99-1ubuntu1~18.04.1) ...
Setting up libgl1-mesa-dri:amd64 (19.2.1-1ubuntu1~18.04.1) ...
Setting up libglx-mesa0:amd64 (19.2.1-1ubuntu1~18.04.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for mime-support (3.60ubuntu1) ...

and the I run the previous command again I get this output

cypress run --config-file ./cypress/cypress.json
The Test Runner unexpectedly exited via a exit event with signal SIGSEGV

Please search Cypress documentation for possible solutions:

https://on.cypress.io

Check if there is a GitHub issue describing this crash:

https://github.com/cypress-io/cypress/issues

Consider opening a new issue.

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.8.2

A workaround found by @krishofmans is running your command prefixed with xvfb-run --server-args="-screen 0 1024x768x24"

We are seeing this as well, but our detailed error description isn't the same as the one listed above.

Ours is:

If you are using Docker, we provide containers with all required dependencies installed.

----------

Command failed: /root/.cache/Cypress/3.8.2/Cypress/Cypress --no-sandbox --smoke-test --ping=47

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.8.2
    at /opt/plangrid/my_repo/node_modules/cypress/lib/errors.js:250:15
    at tryCatcher (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._resolveCallback (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:432:57)
    at Promise._settlePromiseFromHandler (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:524:17)
    at Promise._settlePromise (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._resolveCallback (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:432:57)
    at Promise._settlePromiseFromHandler (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:524:17)
    at Promise._settlePromise (/opt/plangrid/my_repo/node_modules/cypress/node_modules/bluebird/js/release/promise.js:569:18) known: true, context: [Object: null prototype] {} }

Due to this, the workaround listed above doesn't appear to work. I wouldn't normally assume they're the same issue, but they seem to have appeared along the same timeline.

I logged this as well but thought it was resolved yesterday so I closed my issue. We're still seeing this and this issue has output with debug logging turned on: https://github.com/cypress-io/cypress/issues/6182

We are facing the same issue - we assume that the error is caused by one of these packages:

libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libgcrypt20 libglapi-mesa libglx-mesa0 libgnutls30 libllvm8 libsystemd0 libudev1

All of them are also in the list of @GertVil. As quickfix we switched back to an older base image.

We got this issue since yesterday after our container has been rebuilt. I couldn't figure out which package causes this problem.

We are using the same packages which are implemented in the cypress/base:10 dockerfile.

RUN apt-get update && \
  apt-get install -y \
    libgtk2.0-0 \
    libnotify-dev \
    libgconf-2-4 \
    libnss3 \
    libxss1 \
    libasound2 \
    xvfb

Got the source of the problem, Xvfb is run without -screen so electron dies with:

Received signal 11 SEGV_MAPERR ffffef7352286c69
#0 0x56379509d3d9 (/root/.cache/Cypress/3.8.2/Cypress/Cypress+0x35d13d8)
r8: 0000000000000000  r9: 00007ffe15194500 r10: 00007ffe15194458 r11: 000000000000000e
r12: 00007ffe151945ac r13: 00007f595336d720 r14: ffffef7352286c39 r15: 00007f5954966200
di: 0000000000000000  si: 0000000000000020  bp: 0000000000000000  bx: 0000108e1c720e70
dx: 0000000000000001  ax: 0000000000000030  cx: 0000000000000001  sp: 00007ffe15194580
ip: 00007f595494a2dd efl: 0000000000010246 cgf: 002b000000000033 erf: 0000000000000005
trp: 000000000000000e msk: 0000000000000000 cr2: ffffef7352286c69
[end of stack trace]
Calling _exit(1). Core file will not be generated.

If is set fallback this._xvfb_args = options.xvfb_args || [ '-screen', '0', '1024x768x24' ] at @cypress/xvfb it looks like everything works.

I also hit the same issue since yesterday. The instance is started on a clean docker container with all the necessary package mentioned in the cypress.io website.

I worked around this by pre-pending the commands with xvfb-run .... The path that led me to this:

  1. DEBUG=cypress:cli,xvfb cypress verify says

    cypress:cli error message: Command failed: /root/.cache/Cypress/3.8.2/Cypress/Cypress --no-sandbox --smoke-test --ping=780
    
    0ms
    cypress:cli Stopping Xvfb +238ms
    xvfb restoring process.env.DISPLAY variable +222ms
    xvfb lock filename /tmp/.X99-lock +0ms
      Verifying Cypress can run /root/.cache/Cypress/3.8.2/Cypress
      Verifying Cypress can run /root/.cache/Cypress/3.8.2/Cypress
    
  2. from that I just ran the command that was printed /root/.cache/Cypress/3.8.2/Cypress/Cypress and got

    root@62b22c856f77:/home/toto/src# /root/.cache/Cypress/3.8.2/Cypress/Cypress --no-sandbox
    
    (Cypress:411): Gtk-WARNING **: 12:30:29.946: cannot open display:
    

    while the previous message clearly indicates that it runs xvfb

  3. redoing the same command with xvfb-run just works:

    root@62b22c856f77:/home/toto/src# xvfb-run cypress verify
    It looks like this is your first time using Cypress: 3.8.2
    
     ✔  Verified Cypress! /root/.cache/Cypress/3.8.2/Cypress
    

So all in all it looks like a bug in Cypress, certainly related to #4624 .

I'm seeing the same issue with a bionic docker image. We pinpointed it to the following packages:

libglx-mesa0:amd64 (19.2.1-1ubuntu1~18.04.1 -> 19.0.8-0ubuntu0~18.04.3)
libglapi-mesa:amd64 (19.2.1-1ubuntu1~18.04.1 -> 19.0.8-0ubuntu0~18.04.3)

Wrapping our invocation of cypress with xvfb-run -s '-screen 0 1024x768x24' worked around this issue.

The code for this is done in cypress-io/cypress#6199, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

Temporary workaround

Start Xvfb yourself before running Cypress

Xvfb :1 -screen 0 1280x800x24 &
export DISPLAY=:1
npx cypress verify
npx cypress run

Alternatively, you can use xvfb-run to wrap the commands:

xvfb-run npx cypress verify
xvfb-run npx cypress run

Interesting, Ubuntu19 image works just fine https://github.com/cypress-io/cypress-docker-images/pull/213

Released in 3.8.3.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v3.8.3, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stormherz picture stormherz  Â·  3Comments

tahayk picture tahayk  Â·  3Comments

weskor picture weskor  Â·  3Comments

zbigniewkalinowski picture zbigniewkalinowski  Â·  3Comments

Francismb picture Francismb  Â·  3Comments