Cypress: Crash when attempting to run Linux Cypress on Windows

Created on 2 Mar 2017  ·  30Comments  ·  Source: cypress-io/cypress

Since version 10, Windows has implemented a Linux compatibility layer that allows to run unmodified 64bit Linux binaries from Windows, transparently, see https://msdn.microsoft.com/fr-fr/commandline/wsl/about

While waiting for the Windows version and to avoid having to start a whole Linux using a VM I tried to run Cypress Linux version from Windows but unfortunately it doesn't work.

After uncompressing the zip Linux package and running the Cypress binary I am getting this error:

Assertion 'pthread_mutex_unlock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:108, function pa_mutex_unlock(). Aborting.
Abandon (core dumped)

Any idea ?

linux windows

Most helpful comment

You can use cypress open from WSL, but you need to have an X display server available.

Here are the steps I followed to get Linux Cypress under WSL running in Windows:

  1. In Windows, install Xming (or another X server): https://sourceforge.net/projects/xming/
  2. Start Xming.
  3. Start WSL (tested with Debian from the Windows Store)
  4. Install Node. I used nvm for this.
  5. Install dependencies: sudo apt install libgtk-3-0 libxss1 libgconf-2-4 libasound2
  6. Install Cypress: npm i -g cypress for global mode, or npm i if you're already in your project.
  7. Set your display server to point to localhost and start Cypress: DISPLAY=localhost:0.0 cypress open

image

image

I haven't tried installing Google Chrome inside of WSL, but it works with the installed Electron browser.

All 30 comments

I tried installing xvfb for display and vncserver to connect to it with a vnc viewer, then when running Cypress from the terminal, nothing really happens. Running this .cypress/Cypress/Cypress gives

qwerty@l0089:~/.cypress/Cypress$ ./Cypress 
Xlib:  extension "XInputExtension" missing on display ":1".
[6622:0529/150147:FATAL:udev_linux.cc(20)] Check failed: monitor_. 
#0 0x000001e52dce <unknown>
#1 0x000001e68acb <unknown>
#2 0x000000cb9916 <unknown>
#3 0x000001243802 <unknown>
#4 0x000001e53a96 <unknown>
#5 0x000001e6efc5 <unknown>
#6 0x000001e6f2b8 <unknown>
#7 0x000001e6f70b <unknown>
#8 0x000001e48ed9 <unknown>
#9 0x000001e87c8e <unknown>
#10 0x000001ea6c7a <unknown>
#11 0x0000027026a6 <unknown>
#12 0x0000027028ae <unknown>
#13 0x000001ea6d3e <unknown>
#14 0x000001ea32c3 <unknown>
#15 0x7ff74a9476ba start_thread
#16 0x7ff74429682d clone

Aborted (core dumped)

So, I reinstalled the Windows Subsystem for Linux, nvm, node and Cypress, running the cypress open says

 -Error-
Could not start Cypress headlessly. Your CI provider must support XVFB.

After installing Xming the error is gone, however, nothing else happens neither.

I am experiencing the same issue as @vferko. I've installed Xvfb on my Ubuntu Bash terminal on Windows 10, and cypress run does nothing. I don't receive any error messages.

Under the hood, Cypress is calling xvfb-run and swallowing errors since it's rather noisy. Does running the command below produce any output?

xvfb-run -a -s "-screen 0 1280x1024x24” </path/to/Cypress> --run-project=</path/to/project>

@RandallKent It tells me that --run-project is an unknown option:

error: unknown option '--run-project'

I've changed the command to the following, and it does not produce any output:

xvfb-run -a -s "-screen 0 1280x1024x24” </path/to/Cypress> -run-project=</path/to/project>

Are you replacing </path/to/Cypress> with the actual path to Cypress?

@RandallKent Yes, I am.

You can now install Windows normally without trying to run it in Windows Linux.

Fixed in 1.0.0.

I've tried Cypress through npm, and I got it installed fine.
But running DEBUG=cypress:* npx cypress open gives the following output, and then the four dots spins in place forever (I held out for 30 mins).
Debug output: https://gist.github.com/marcusnielsen/814e6693722ab2ded060969aec74aa83 .
Seems related to running CircleCI v1 with docker: https://github.com/cypress-io/cypress/issues/673 .

@marcusnielsen what OS are you running? Is this in CI or your local computer?

@marcusnielsen it seems you're trying to run Windows on WSL, which does not work - neither does Atom or any other Electron app for that matter.

https://www.google.com/search?q=atom+electron+wsl&oq=atom+electron+wsl&aqs=chrome..69i57j69i60l3j0.1351j0j9&sourceid=chrome&ie=UTF-8

It seems that Cypress is working for me on WSL. I am not sure if that is recently supported.

@TDHTTTT just wondering, did you mean you got it working headless or opening a browser window?

@TDHTTTT I'd love to know how you got this working. I'm currently getting Segmentation fault (core dumped) when I try to run the xvfb-run -a -s "-screen 0 1280x1024x24” </path/to/Cypress> -run-project=</path/to/project> command.

@TDHTTTT I would also like to know how you got this working in WSL. From a WSL command line I can run my tests with cypress run, but cypress open does not launch a cypress window as I'd hoped.

You can use cypress open from WSL, but you need to have an X display server available.

Here are the steps I followed to get Linux Cypress under WSL running in Windows:

  1. In Windows, install Xming (or another X server): https://sourceforge.net/projects/xming/
  2. Start Xming.
  3. Start WSL (tested with Debian from the Windows Store)
  4. Install Node. I used nvm for this.
  5. Install dependencies: sudo apt install libgtk-3-0 libxss1 libgconf-2-4 libasound2
  6. Install Cypress: npm i -g cypress for global mode, or npm i if you're already in your project.
  7. Set your display server to point to localhost and start Cypress: DISPLAY=localhost:0.0 cypress open

image

image

I haven't tried installing Google Chrome inside of WSL, but it works with the installed Electron browser.

This works great @flotwig. Thanks for the help!

Doesn't work for me, sadly -- I get this:

% DISPLAY=localhost:0.0 npx cypress open
It looks like this is your first time using Cypress: 3.7.0

 ✔  Verified Cypress! /home/garyo/.cache/Cypress/3.7.0/Cypress

Opening Cypress...
[11918:1209/152533.582219:ERROR:bus.cc(396)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
shared memfd open() failed: Function not implemented
[11918:1209/152554.708103:FATAL:gpu_data_manager_impl_private.cc(892)] The display compositor is frequently crashing. Goodbye.

(and in fact there is no /var/run/dbus, as it suggests.)

On my WSL 2, @flotwig approach didn't work out. It kept showing the following error.
(Cypress:9268): Gtk-WARNING **: 23:26:34.936: cannot open display: localhost:0.0
But fortunately someone wrote an awesome tutorial on how to make it work with WSL 2.
https://nickymeuleman.netlify.com/blog/gui-on-wsl2-cypress

I just had to change the last command to node_modules/.bin/cypress open (per project install of cypress)

Doesn't work for me, sadly -- I get this:

% DISPLAY=localhost:0.0 npx cypress open
It looks like this is your first time using Cypress: 3.7.0

 ✔  Verified Cypress! /home/garyo/.cache/Cypress/3.7.0/Cypress

Opening Cypress...
[11918:1209/152533.582219:ERROR:bus.cc(396)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
shared memfd open() failed: Function not implemented
[11918:1209/152554.708103:FATAL:gpu_data_manager_impl_private.cc(892)] The display compositor is frequently crashing. Goodbye.

(and in fact there is no /var/run/dbus, as it suggests.)

I'm having the exact same issue, did you manage to get passed it?

/Ivan

I didn't, @MrBayene . Moved on to other things.

I didn't, @MrBayene . Moved on to other things.

@garyo Bummer, but thanks for the quick reply!

Hey, @MrBayene did you manage to solve this, I'm also getting the same issue now.

:FATAL:gpu_data_manager_impl_private.cc(892)] The display compositor is frequently crashing. Goodbye.

I'm having a similar issue. I tried upgrading to WSL 2, but inotify isn't fully working yet, so saving changes to my tests isn't reflecting. (See: https://github.com/cypress-io/cypress/issues/7756)

I downgraded back to WSL 1, and I get:

> cypress open

[3023:0618/132414.459986:ERROR:edid_parser.cc(102)] Too short EDID data: manufacturer id
[3023:0618/132414.574784:WARNING:gpu_process_host.cc(1166)] The GPU process has crashed 1 time(s)
[3023:0618/132414.681023:WARNING:gpu_process_host.cc(1166)] The GPU process has crashed 2 time(s)
[3023:0618/132414.779059:WARNING:gpu_process_host.cc(1166)] The GPU process has crashed 3 time(s)
[3023:0618/132414.853563:WARNING:gpu_process_host.cc(1166)] The GPU process has crashed 4 time(s)
[3023:0618/132416.631161:WARNING:gpu_process_host.cc(1166)] The GPU process has crashed 5 time(s)
[3023:0618/132416.721341:WARNING:gpu_process_host.cc(1166)] The GPU process has crashed 6 time(s)
[3023:0618/132416.721593:FATAL:gpu_data_manager_impl_private.cc(1034)] The display compositor is frequently crashing. Goodbye.

Other x11 test apps seem to work using VcXsrv,

# sudo apt-get install x11-apps
# export DISPLAY=:0
# xeyes 

Sadly the instructions from @flotwig above on haven't worked for me on WSL (not WSL2).
When I try to open Cypress it just hangs on the verifying stage

⠦ Verifying Cypress can run /home/george/.cache/Cypress/4.9.0/Cypress

I am able to open xeyes as per @jakedowns suggestion.

Although this issue contains quite a lot of detailed information and active discussion on getting Cypress working on WSL (and WSL2) it was closed several years ago. I wonder if there is there a more relevant issue where this currently active discussion should take place?

There's an open issue for The display compositor is frequently crashing error in WSL 1: https://github.com/cypress-io/cypress/issues/5918

it works :-D
unset NODE_OPTIONS; unset DISPLAY; npx ng e2e
Im using nx and angular.

Does this works on WSL 1 ? my windows new version is on the way !

@georgewilde Did you manage to make it work ? I still have Cypress hanging on the verifying stage too.

For me this works on WSL2 (install and start X-Server for Windows first, e.g. https://sourceforge.net/projects/vcxsrv/)

docker run -it -v $PWD:/e2e -w /e2e -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=host.docker.internal:0.0 --entrypoint cypress cypress/included:5.5.0 open --project .
Was this page helpful?
0 / 5 - 0 ratings

Related issues

weskor picture weskor  ·  3Comments

tahayk picture tahayk  ·  3Comments

szabyg picture szabyg  ·  3Comments

egucciar picture egucciar  ·  3Comments

rbung picture rbung  ·  3Comments