We have a few issues floating around about errors during cypress verify
that we have not been able to reproduce and have not been fixed as of Cypress v3.3.2.
This issue is the epic issue to track them all in one place. All the other issues have been closed and direct users to comment here.
It looks like this is your first time using Cypress: xxx
✖ Verifying Cypress can run /Users/benjamin/Library/Caches/Cypress/xxx/Cypress.app
→ Cypress Version: xxx
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: /Caches/Cypress/xxx/Cypress.app/Contents/MacOS/Cypress --smoke-test --ping=584
----------
Platform: xxx
Cypress Version: xxx
DEBUG:cypress*
mode display this stacktrace at makeError
cypress:cli needs XVFB? false +0ms
cypress:cli smoke test command: ../Cypress --smoke-test --ping=310 +0ms
cypress:cli Smoke test failed: {
Error: Command failed: ../Cypress --smoke-test --ping=310
at makeError (../node_modules/execa/index.js:172:9)
at Promise.all.then.arr (../node_modules/execa/index.js:277:16)
at process._tickCallback (internal/process/next_tick.js:68:7)
code: 1,
stdout: '',
stderr: '',
failed: true,
signal: null,
cmd: '../Cypress --smoke-test --ping=310',
timedOut: false,
killed: false
} +43ms
Verifying Cypress can run /home/circleci/.cache/Cypress/3.1.5/Cypress [failed]
code
values in this stack trace are either 1
or null
.9
and was solved by running under sudo
. 3221225781
- SEE THIS ISSUE INSTEAD: https://github.com/cypress-io/cypress/issues/4625Some people mentioned that restarting their computer fixed it. /shrug
Basically any way you can run or open Cypress - people run into this issue
npx cypress open
cypress open
./node_modules/cypress/bin/cypress open
yarn cypress run
Cypress Versions: 3.0.1 ~ 3.3.1
OS Versions:
cypress cache clear
cypress verify
BY ITSELF (not cypress open
or cypress run
)sudo apt-get install xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2
Hi together,
I had the same issue, but could fix it finally, but this might only apply to the people who in their logs have
timedOut: **true**,
killed: **true**
Workaround: adjust smoketest timeout per hand in node_modules\cypress\lib\tasks\verify.js
eg. smokeTestTimeout: 1500
to smokeTestTimeout: 100000
I guess it might be due to my AntiVirus or Company policy checks, that it takes much longer than the 1.5 seconds.
Feature-Suggestion (does not exist yet): Enabling smokeTestTimeout as an option for cypress verify
like
npx cypress verify --smokeTestTimeout=100000
I hope this can help others.
Platform: win32 (10.0.15063)
Cypress Version: 3.3.2
Is this option available on mac/linux? Tried both, same error.
➜ npx cypress verify --smokeTestTimeout=60000
error: unknown option: --smokeTestTimeout
Usage: verify [options]
Verifies that Cypress is installed correctly and executable
Options:
--dev runs cypress in development and bypasses binary check
-h, --help output usage information
➜ npx cypress --version
Cypress package version: 3.3.2
Cypress binary version: 3.3.2
@justinpincar the option does not exist yet, as far as I'm aware, this was a feature suggestion for the future by my side.
You actually have to go to the verify.js
file under node_modules/cypress/lib/tasks
and change it per hand in the file.
Ah, understood - I'll hack this change into our CI workflow and see if it helps.
@jennifer-shehane it would be great if Cypress exposed this option.
@justinpincar were you able to update your CI workflow to increase verify timeout?
Thanks
@jedwantstocode Only had it in for a few builds, but so far so good. For some reason my smoke test seems to take between 9s to 11s, resulting in sporadic timeouts with the default value of 10s. Haven't seen a failure to verify yet since adding this.
- DEBUG=cypress:* npx cypress install
- "sed -i.bak 's/smokeTestTimeout: 10000/smokeTestTimeout: 60000/' node_modules/cypress/lib/tasks/verify.js"
- DEBUG=cypress:* npx cypress verify
Not a very robust solution, but better than flaky CI :-)
I got this thank you
On Mon, 8 Jul. 2019, 12:26 pm Justin Pincar, notifications@github.com
wrote:
@jedwantstocode https://github.com/jedwantstocode Only had it in for a
few builds, but so far so good. For some reason my smoke test seems to take
between 9s to 11s, resulting in sporadic timeouts with the default value of
10s. Haven't seen a failure to verify yet since adding this.- DEBUG=cypress:* npx cypress install - "sed -i.bak 's/smokeTestTimeout: 10000/smokeTestTimeout: 60000/' node_modules/cypress/lib/tasks/verify.js" - DEBUG=cypress:* npx cypress verify
Not a very robust solution, but better than flaky CI :-)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/cypress-io/cypress/issues/4624?email_source=notifications&email_token=ADCJTW4PLXLSQ7ZXPOTPKF3P6KQWDA5CNFSM4H4QBCFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLZORA#issuecomment-509056836,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADCJTW454KQBLBJOMK6PPP3P6KQWDANCNFSM4H4QBCFA
.
@j-viczian where do you see timing out during cypress verify
? Because we have increased the verify
time out to 10 seconds in https://github.com/cypress-io/cypress/pull/4080
Could you paste the debug logs from the timed out verify, please?
hello, i had a sort-a-like problem, we were on the new 3.4.0 version, and our verify function got a timeout. What we did as WORK-A-ROUND, copied the file binary_state.json from the 3.2.0 version to the 3.4.0 folder and then cypress skips the verify function ... again not a solution, but it got us going again.
the content of this file is just:
{
"verified": true
}
hi, we are seeing a similar problem after upgrading to 3.4.0
. Our tests are running inside a Docker container. I see the following error.
Not so sure if this is a Cypress thing or a Docker issue while trying to verify it. Thanks for all the help!
It looks like this is your first time using Cypress: 3.4.0
[22:14:46] Verifying Cypress can run /root/.cache/Cypress/3.4.0/Cypress [started]
[22:15:06] Verifying Cypress can run /root/.cache/Cypress/3.4.0/Cypress [failed]
Cypress verification timed out.
This command failed with the following output:
/root/.cache/Cypress/3.4.0/Cypress/Cypress --smoke-test --ping=679
----------
Command failed: /root/.cache/Cypress/3.4.0/Cypress/Cypress --smoke-test --ping=679
----------
Platform: linux (Debian - 9.6)
Cypress Version: 3.4.0
Service 'cypress' failed to build: The command '/bin/sh -c ./node_modules/.bin/cypress verify' returned a non-zero code: 1
Hi @srideeps
In order for us to track down this problem, please try installing Cypress with debug logs enabled and then paste the logs (as a code snippet). You can run Cypress install like this (I would also like to see XVFB records):
DEBUG=cypress:cli,xvfb npm install cypress
or on Windows
set DEBUG=cypress:cli,xvfb
npm install cypress
Also, in Docker container, could you do the ldd
command to see if any dependencies are missing? https://docs.cypress.io/guides/guides/debugging.html#Run-the-Cypress-app-by-itself
hi @bahmutov this issue got magically resolved the next time I ran it.
Thanks for providing debug options, will try for sure when I see it the next time.
Cheers to the Cypress team! 🥂
cy version 3.4.0
npm version 5.6
node version 8.10
Hello.
I face this issue on my TeamCity agents each time after cypress is updated by new version.
This issue isn't reproduced on my local env.
I would like to share information that I get and solution for my TeamCity configuration.
Maybe it would help to reproduce this issue and fix it globally.
Below you can find output with "set DEBUG=*" when verification is failed
I've checked 3 things with this issue
Checked env var NODE_OPTIONS, NODE_ENV cause some people noted that verification timeout could be when there are some values. For me they are empty
cypress cache clear
and cypress install
helps perfectly each time, but I do not want to reinstall cypress for all my 5 TeamCity workers each time after update cypress.
so I've added TeamCity build step where in PowerShell I patch verify.js file and it works for me
(Get-Content -path .\node_modules\cypress\lib\tasks\verify.js -Raw) -replace 'smokeTestTimeout: 10000','smokeTestTimeout: 20000' | Set-Content -Path .\node_modules\cypress\lib\tasks\verify.js
I am running into this issue as well using the cypress/base:10
Docker image on a Jenkins server. I modified by build to set DEBUG=cypress:cli,xvfb
and I collected the output here:
https://gist.github.com/msabramo/6730804bbd5ad7b8934eb0919a75f6f3
I hope this helps diagnose the issue!
and here's the Dockerfile
I'm using in case it helps:
https://gist.github.com/msabramo/2d5f18863db601e5ba6435f9405b9c63
Thank you @msabramo for the detailed log and Dockerfile. I have built your Dockerfile locally and I can recreate the error IF I limit the CPU allocated to the container to a very small number. Here is my command (I commented out cypress verify
command from the Docker built)
$ docker run --cpus=0.1 d480499238a7 npm run cypress:verify
> [email protected] cypress:verify /usr/src/app
> cypress verify
...
2019-07-26T21:27:15.023Z cypress:cli smoke test command: /root/.cache/Cypress/3.4.0/Cypress/Cypress --smoke-test --ping=897
2019-07-26T21:27:25.527Z cypress:cli Smoke test failed: { Error: Command failed: /root/.cache/Cypress/3.4.0/Cypress/Cypress --smoke-test --ping=897
at makeError (/usr/src/app/node_modules/cypress/node_modules/execa/index.js:172:9)
at Promise.all.then.arr (/usr/src/app/node_modules/cypress/node_modules/execa/index.js:277:16)
at process._tickCallback (internal/process/next_tick.js:68:7)
code: null,
stdout: '',
stderr: '',
failed: true,
signal: 'SIGTERM',
cmd:
'/root/.cache/Cypress/3.4.0/Cypress/Cypress --smoke-test --ping=897',
timedOut: true,
killed: true }
2019-07-26T21:27:25.527Z cypress:cli error message: Command failed: /root/.cache/Cypress/3.4.0/Cypress/Cypress --smoke-test --ping=897
2019-07-26T21:27:25.528Z cypress:cli error timedOut is true
2019-07-26T21:27:26.322Z cypress:cli Stopping Xvfb
2019-07-26T21:27:26.420Z xvfb restoring process.env.DISPLAY variable
2019-07-26T21:27:26.420Z xvfb lock filename /tmp/.X99-lock
2019-07-26T21:27:26.420Z xvfb lock file /tmp/.X99-lock
2019-07-26T21:27:26.930Z xvfb lock file /tmp/.X99-lock not found when stopping
[21:27:27] Verifying Cypress can run /root/.cache/Cypress/3.4.0/Cypress [failed]
Cypress verification timed out.
This command failed with the following output:
/root/.cache/Cypress/3.4.0/Cypress/Cypress --smoke-test --ping=897
----------
Command failed: /root/.cache/Cypress/3.4.0/Cypress/Cypress --smoke-test --ping=897
----------
Platform: linux (Debian - 8.11)
Cypress Version: 3.4.0
which makes me suspect that in an underpowered container, verification should use a higher time limit. I could pass verification by increasing the timeout in the node_modules/cypress/lib/tasks/verify.js file, so we should probably bump this in our code by default.
The code for this is done in cypress-io/cypress#4859, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
Released in 3.4.1
.
Problem still persists in 3.4.1
Platform: darwin (18.7.0)
Cypress Version: 3.4.1
What worked for me in 3.4.1 was clearing the cache and re-installing:
npx cypress cache clear
npx cypress install
npx cypress open
@AngSin didn't work, I get the following error, I think it's different than it was. It's run as a pre-commit hook. Could that be an issue?
/Users/xx/Library/Caches/Cypress/3.4.1/Cypress.app/Contents/MacOS/Cypress: bad option: --run-project
npm ERR! code ELIFECYCLE
npm ERR! errno 9
npm ERR! [repo-name] test:cy: `cypress run`
npm ERR! Exit status 9
Can confirm, this issue is still happening with 3.4.1 even with clearing cache.
We are running Cypress 3.7.0 and we see this problem periodically as well. We run Cypress in Docker containers as part of our CI and sometimes they may be underpowered, as has been noted in this issue. Unfortunately the logs don't really provide any color here:
15:51:06 [23:51:01] Verifying Cypress can run /home/jenkins/.cache/Cypress/3.7.0/Cypress [started]
15:51:38 [23:51:35] Verifying Cypress can run /home/jenkins/.cache/Cypress/3.7.0/Cypress [failed]
It would appear that 30 seconds is sometimes just not enough time. Is there some way we can set this timeout in our Cypress config? Or a way we can disable this test altogether? Either of these would be much more preferable than Cypress failing, which wastes a lot of our time because our tasks have to be restarted.
This issue will be closed to further comment as the exact issue here was resolved and tested.
If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.
Most helpful comment
What worked for me in 3.4.1 was clearing the cache and re-installing: