cypress: Cypress verify command failing

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).

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

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’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"

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 .

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

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

Temporary workaround

Start Xvfb yourself before running Cypress

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