cypress: Failure during cypress verify step --smoke-test / throwing at makeError

Current behavior:

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.

The error looks something like this:

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

Some of the output when run in 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]

Most of the code values in this stack trace are either 1 or null.

Some people mentioned fixes?

Some people mentioned that restarting their computer fixed it. /shrug

Steps to reproduce: (app code and test code)

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

Versions

Cypress Versions: 3.0.1 ~ 3.3.1 OS Versions:

  • darwin (18.2.0)
  • darwin (18.0.0)
  • darwin (17.6.0)
  • darwin (17.5.0)
  • macOS Mojave 10.14.3
  • Debian 9.6
  • linux (Debian - 9.8)
  • linux (Ubuntu Linux - 18.04)
  • win32 (6.3.9600)
  • win32 (10.0.17134)

Try this before commenting!

  • Update to the most recent version of Cypress: https://on.cypress.io/changelog
  • Clear your cache by running cypress cache clear
  • Try to run cypress verify BY ITSELF (not cypress open or cypress run)
  • Ensure dependencies are installed sudo apt-get install xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 24 (6 by maintainers)

Most upvoted comments

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

Problem still persists in 3.4.1

Platform: darwin (18.7.0)
Cypress Version: 3.4.1

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

> cypress-test-tiny@1.0.0 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.

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.

Released in 3.4.1.

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

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

@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?

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