-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot cypress verify
- Hangs on Smoke Test on WSL2
#7065
Comments
Can you try the steps mentioned in #4624 |
Can you try clearing the cypress cache via |
I'm also having this problem. I have the same system versions.
some minor observations that might help.
This is my install log. (
Let me know if there's any more info needed. |
I was in a similar case (WSL 1 - Ubuntu 18 - Windows 10 - Cypress 4.4 or 4.5) and migrating to WSL 2 seems to fix the issue |
I am having similar problems, it just keeps on hanging on Window 10 - WSL version 1 - This is the debug output: DEBUG=cypress:* node_modules/.bin/cypress open
cypress:cli:cli cli starts with arguments ["/usr/bin/node","/home/bjodol/Code/ClientApp/node_modules/.bin/cypress","open"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli:cli program parsing arguments +2ms
cypress:cli:cli opening Cypress +1ms
cypress:cli parsed cli options {} +155ms
cypress:cli opening from options {"project":"/home/bjodol/Code/ClientApp"} +0ms
cypress:cli command line arguments ["--project","/home/bjodol/Code/ClientApp"] +0ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +0ms
cypress:cli checking if executable exists /home/bjodol/.cache/Cypress/4.5.0/Cypress/Cypress +3ms
cypress:cli Binary is executable? : true +3ms
cypress:cli binaryDir is /home/bjodol/.cache/Cypress/4.5.0/Cypress +0ms
cypress:cli Reading binary package.json from: /home/bjodol/.cache/Cypress/4.5.0/Cypress/resources/app/package.json +0ms
cypress:cli Found binary version 4.5.0 installed in: /home/bjodol/.cache/Cypress/4.5.0/Cypress +3ms
cypress:cli could not read binary_state.json file at "/home/bjodol/.cache/Cypress/4.5.0/binary_state.json" +3ms
cypress:cli {} +1ms
cypress:cli is Verified ? undefined +2ms
cypress:cli running binary verification check 4.5.0 +1ms
It looks like this is your first time using Cypress: 4.5.0
cypress:cli clearing out the verified version +3ms
cypress:cli undefined DISPLAY environment variable +0ms
cypress:cli Cypress will spawn its own Xvfb +0ms
cypress:cli needs Xvfb? true +9ms
cypress:cli Starting Xvfb +1ms
cypress:cli disabling Electron sandbox +42ms
cypress:cli running smoke test +0ms
cypress:cli using Cypress executable /home/bjodol/.cache/Cypress/4.5.0/Cypress/Cypress +1ms
cypress:cli smoke test command: /home/bjodol/.cache/Cypress/4.5.0/Cypress/Cypress --no-sandbox --smoke-test --ping=822 +0ms
cypress:cli smoke test timeout 30000 ms +0ms
⠇ Verifying Cypress can run /home/bjodol/.cache/Cypress/4.5.0/Cypress |
Having literally same troubles. My log output is mostly similar to the one from previous respondent: $ DEBUG=cypress:* npx cypress verify
cypress:cli:cli cli starts with arguments ["/usr/bin/node","/home/vintprox/vuephab/node_modules/.bin/cypress","verify"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli:cli program parsing arguments +4ms
cypress:cli parsed cli options {} +2ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +1ms
cypress:cli checking if executable exists /home/vintprox/.cache/Cypress/4.5.0/Cypress/Cypress +2ms
cypress:cli Binary is executable? : true +2ms
cypress:cli binaryDir is /home/vintprox/.cache/Cypress/4.5.0/Cypress +0ms
cypress:cli Reading binary package.json from: /home/vintprox/.cache/Cypress/4.5.0/Cypress/resources/app/package.json +0ms
cypress:cli Found binary version 4.5.0 installed in: /home/vintprox/.cache/Cypress/4.5.0/Cypress +4ms
cypress:cli could not read binary_state.json file at "/home/vintprox/.cache/Cypress/4.5.0/binary_state.json" +4ms
cypress:cli {} +1ms
cypress:cli is Verified ? undefined +2ms
cypress:cli force verify +1ms
cypress:cli running binary verification check 4.5.0 +0ms
cypress:cli clearing out the verified version +3ms
cypress:cli DISPLAY environment variable is set to localhost:0.0 on Linux
cypress:cli Assuming this DISPLAY points at working X11 server,
cypress:cli Cypress will not spawn own Xvfb
cypress:cli
cypress:cli NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
cypress:cli see https://github.com/cypress-io/cypress/issues/4034
cypress:cli Solution: Unset the DISPLAY variable and try again:
cypress:cli DISPLAY= npx cypress run ... +0ms
cypress:cli needs Xvfb? false +9ms
cypress:cli spawning, should retry on display problem? true +0ms
cypress:cli disabling Electron sandbox +1ms
cypress:cli running smoke test +0ms
cypress:cli using Cypress executable /home/vintprox/.cache/Cypress/4.5.0/Cypress/Cypress +0ms
cypress:cli smoke test command: /home/vintprox/.cache/Cypress/4.5.0/Cypress/Cypress --no-sandbox --smoke-test --ping=745 +1ms
cypress:cli smoke test timeout 30000 ms +4ms
⠼ Verifying Cypress can run /home/vintprox/.cache/Cypress/4.5.0/Cypress Software UsedWindows Linux Subsystem - Ubuntu 20.04 after upgrade As you may guess, it's WSL 1, but my hardware seems to be refusing to upgrade, so I'm unable to solve Cypress issue with WSL 2. HistoryHere's very long ticket about But I don't see its action in Cypress 4.5.0. I wonder if #3807 actually commits to better log output of cypress, and it's just being overlooked. Mangling permissions on Before, all dependencies were installed without problem on Ubuntu, WSL bash rerun: sudo apt install libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb Both Giving second thought, maybe WSL isn't viable for running any tests. How one can be sure that result will be the same when this black box receives changes? xD |
I have the same setup as @vintprox -- except Cypress 4.6 -- and I've tried all the suggested fixes with no luck. My debug output looks the same as his. |
Same here with 4.6.0 on Jeninks CI pipeline. I saw on another thread installing WSL can solve the issue but there is no way it is the ONLY solution. The longer this remains unsolved more people will move on to other e2e candidates. |
OK, so I was able to solve the issue after 3 days of effort. I would suggest anyone to start with the Debug turned on and even with a -verbose flag when running cypress verify and cypress run. In my case the log indicates cypress cli smoke test timed out due to cypress wants root access. And after going through this issue: #2821 (comment) I was able to get it working on my linux server. Hope this helps others, I am just a js developer and if I can figure this out, you can too. |
Unfortunately still haven't made progress. I've tried reading #2821 (and other referenced sources) as @Nanstop suggested, but nothing's changed
This is my debug output now:
@Nanstop , could you maybe clarify fixed the problem for you? What was cypress trying to access as root? |
I had the issue of smoke test hanging as well when running a container on cypress/base, and using it to 'yarn install', './node_modules/cypress/bin/cypress install', 'cypress run'
Adding the ENV is what abated the hang on smoke test for me. |
I am seeing the same behavior with 4.7.0. Hangs on smoketest and never completes. |
I'm seeing the same behaviour with 4.8.0 on Jenkins. Jenkins starts a docker image based on cypress/browsers. Cypress runs fine locally in this image, but hangs on Jenkins. Dockerfile:
Debug output on Jenkins:
Debug output in Docker running locally (on Kubuntu):
ldd output:
|
Same here. Cypress runs fine locally in this image, but hangs on Jenkins. |
After a lot of debugging, I found the solution, which is actually quite simple. Jenkins runs docker with a user mapping -u 996:994 With HOME set to /tmp, everything now works fine. Perhaps adding a check to cypress whether HOME is writable would be helpful? |
@JochenDiekenbrock I'm glad you've found "a" solution but I don't think it's "the" solution as you're using Docker and the original issue raised relates to WSL on Windows, not Docker. I just want to ensure that someone doesn't close this issue thinking we have a solution as there is still no current solution or workaround that fixes the original description. I can confirm that I am using WSL (not WSL2) on Windows and am still experiencing this issue. The output from running
The command never completes and there is no further output. I have tried the steps outlined in #4624 and am using the latest version of Cypress, currently |
@timharsch your solution worked for me on WSL2. I had a |
I'm having this issue now on a second account I have on my windows machine. I have wsl 2 set up just fine on my main account. On the second account I'm now having this issue. I tried replicating the steps I followed to set up on my main account, I'm now stuck with this error. |
cypress verify
- Hangs on Smoke Test on WSL2
Using cypress 5.1.0 on Windows 10 Azure VM on latest ubuntu wsl1 instance. |
weird as is does not work with HOME=. or something - may be have to be absolute |
Same here, Main Ubuntu disto in store no LTS | cypress 6.4 | WSL1 | Windows 10 Enterprise v.2004
I'm planning on switching to WSL2 once its networking issues are resolved |
Same here in WSL2 Ubuntu 20.04 LTS and Cypress 8.0.0 if DISPLAY env variable is set it fails but unsetting the variable by doing so is making it work :
|
Yeah, but the problem is that if you unset DISPLAY, you're preventing Cypress from launching the GUI since it has no display to connect to. |
I've faced this same issue and after a long research I've identified that my problem is related to webpack build, so I've tried to build(npm run build) and my webpack run out of memory(WSL), I've 32GB of RAM and this still happends, so I just run this export NODE_OPTIONS=--max_old_space_size=8192 and cypress work again, took me some months to discover this as cypress doesn't stop or show errors related to webpack build(just when succeed). Hope I can help you(I've never found that related solution). |
It sounds like you are describing a different problem, as the original issue was about |
Does this issue need to stay open? There have been some major enhancements to WSL2 through Windows Subsystem for Linux GUI (WSLg) which provides a GUI environment for WSL2 out-of-the-box.
I have not seen this problem occurring on Windows 11. The only issue I had was to build Cypress itself on a laptop I use when I'm traveling which only has 8GB memory. I added
to So the following sequence used on a local clone of https://github.com/cypress-io/cypress ran successfully yarn
yarn dev
npm start --prefix ../cypress-example-kitchensink & yarn cypress:run --project ../cypress-example-kitchensink This implicitly includes the smoke test. Environment
|
Not everyone has the hardware to upgrade to Windows 11, so it's still relevant |
Is it still reproducible on Windows 10 (using the latest version of WSL2 |
Yeah, looks like I'm on outdated info, WSLg support for Windows 10 has been added recently. I'm not sure if this issue is still needed then, I don't have an environment to reproduce it anymore. |
I checked that the Cypress RWA- Real World App also runs successfully under WSL2 (latest version - see #7065 (comment)) on Windows 11. It would be great if somebody could confirm that Cypress also works with WSL2 on Windows 10 with Ubuntu 22.04. The original issue was logged against Ubuntu 18.04, which entered into End of Standard Support in May 2023. |
At this point in time Cypress does not officially support WSL/WSL2. I am going to close this until such time that we decide to fully support WSL/WSL2 |
Current behavior:
I have just installed version
4.4.0
of cypress and integrated it in to my project. I'm using using WSL Ubuntu and have install the suggested packages in the documentation.After trying several fixes as well as reverting the version to earlier versions where I'm met with different issues.
After running
DEBUG=cypress:* yarn run cypress open
it looks like it's getting stuck on the smoke test time out.
Desired behavior:
It should continue to verify and then open Cypress
If anybody could point me in the right direction that would be much appreciated
Versions
Cypress: 4.4.0
Windows 10
Ubuntu 18.04.4 LTS
The text was updated successfully, but these errors were encountered: