Skip to content
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

Can't run cypress verify on Ubuntu 18.04 #6713

Closed
blueo opened this issue Mar 13, 2020 · 6 comments
Closed

Can't run cypress verify on Ubuntu 18.04 #6713

blueo opened this issue Mar 13, 2020 · 6 comments
Assignees

Comments

@blueo
Copy link

blueo commented Mar 13, 2020

Current behavior:

I cannot run cypress (specifically the verify command) on Ubuntu 18.04. It is a new install and I have all the dependencies from: https://on.cypress.io/required-dependencies installed.

example run on a brand new install of cypress 4.1.0 I run:
DEBUG=cypress:* npx cypress verify > output.txt 2>outputerr.txt

output.txt contains:

It looks like this is your first time using Cypress: 4.1.0

[12:07:57]  Verifying Cypress can run /home/bernard/.cache/Cypress/4.1.0/Cypress [started]
[12:07:58]  Verifying Cypress can run /home/bernard/.cache/Cypress/4.1.0/Cypress [failed]
[12:07:58] → 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.

----------

2020-03-12T23:07:57.913Z cypress:ts Running without ts-node hook in environment "production"
2020-03-12T23:07:58.229Z cypress:server:appdata path: /home/bernard/.config/Cypress/cy/production/browsers

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 4.1.0
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.

----------

2020-03-12T23:07:57.913Z cypress:ts Running without ts-node hook in environment "production"
2020-03-12T23:07:58.229Z cypress:server:appdata path: /home/bernard/.config/Cypress/cy/production/browsers

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 4.1.0

and outputerr.txt contains:

2020-03-12T23:10:00.724Z cypress:cli:cli cli starts with arguments ["/home/bernard/.nvm/versions/node/v10.19.0/bin/node","/home/bernard/dev/cypresstester/node_modules/.bin/cypress","verify"]
2020-03-12T23:10:00.726Z cypress:cli NODE_OPTIONS is not set
2020-03-12T23:10:00.726Z cypress:cli:cli program parsing arguments
2020-03-12T23:10:00.728Z cypress:cli parsed cli options {}
2020-03-12T23:10:00.785Z cypress:cli verifying Cypress app
2020-03-12T23:10:00.785Z cypress:cli checking environment variables
2020-03-12T23:10:00.790Z cypress:cli checking if executable exists /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress
2020-03-12T23:10:00.791Z cypress:cli Binary is executable? : true
2020-03-12T23:10:00.791Z cypress:cli binaryDir is  /home/bernard/.cache/Cypress/4.1.0/Cypress
2020-03-12T23:10:00.792Z cypress:cli Reading binary package.json from: /home/bernard/.cache/Cypress/4.1.0/Cypress/resources/app/package.json
2020-03-12T23:10:00.794Z cypress:cli Found binary version 4.1.0 installed in: /home/bernard/.cache/Cypress/4.1.0/Cypress
2020-03-12T23:10:00.795Z cypress:cli could not read binary_state.json file at "/home/bernard/.cache/Cypress/4.1.0/binary_state.json"
2020-03-12T23:10:00.795Z cypress:cli {}
2020-03-12T23:10:00.795Z cypress:cli is Verified ? undefined
2020-03-12T23:10:00.795Z cypress:cli force verify
2020-03-12T23:10:00.795Z cypress:cli running binary verification check 4.1.0
2020-03-12T23:10:00.799Z cypress:cli clearing out the verified version
2020-03-12T23:10:00.800Z cypress:cli DISPLAY environment variable is set to :0 on Linux
Assuming this DISPLAY points at working X11 server,
Cypress will not spawn own Xvfb

NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
  see https://github.com/cypress-io/cypress/issues/4034
Solution: Unset the DISPLAY variable and try again:
  DISPLAY= npx cypress run ...
2020-03-12T23:10:00.800Z cypress:cli needs Xvfb? false
2020-03-12T23:10:00.800Z cypress:cli spawning, should retry on display problem? true
2020-03-12T23:10:00.801Z cypress:cli disabling Electron sandbox
2020-03-12T23:10:00.801Z cypress:cli running smoke test
2020-03-12T23:10:00.801Z cypress:cli using Cypress executable /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress
2020-03-12T23:10:00.801Z cypress:cli smoke test command: /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress --no-sandbox --smoke-test --ping=498
2020-03-12T23:10:00.801Z cypress:cli smoke test timeout 30000 ms
2020-03-12T23:10:01.450Z cypress:cli Smoke test failed: { Error: Command failed: /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress --no-sandbox --smoke-test --ping=498
2020-03-12T23:10:00.928Z cypress:ts Running without ts-node hook in environment "production"
2020-03-12T23:10:01.256Z cypress:server:appdata path: /home/bernard/.config/Cypress/cy/production/browsers


    at makeError (/home/bernard/dev/cypresstester/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/home/bernard/dev/cypresstester/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: null,
  stdout: '',
  stderr:
   '2020-03-12T23:10:00.928Z cypress:ts Running without ts-node hook in environment "production"\n2020-03-12T23:10:01.256Z cypress:server:appdata path: /home/bernard/.config/Cypress/cy/production/browsers\n',
  failed: true,
  signal: 'SIGSEGV',
  cmd:
   '/home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress --no-sandbox --smoke-test --ping=498',
  timedOut: false,
  killed: false }
2020-03-12T23:10:01.451Z cypress:cli error message: 2020-03-12T23:10:00.928Z cypress:ts Running without ts-node hook in environment "production"
2020-03-12T23:10:01.256Z cypress:server:appdata path: /home/bernard/.config/Cypress/cy/production/browsers


it looks like I get this in dmesg:

[14372.512304] Cypress[13354]: segfault at c08 ip 000055ad97de2e01
sp 00007feff3f04630 error 6

I've then tried with DISPLAY= before to run it in Xvfb but I get the same output but the debug messages are slightly different:

2020-03-12T23:15:48.480Z cypress:cli:cli cli starts with arguments ["/home/bernard/.nvm/versions/node/v10.19.0/bin/node","/home/bernard/dev/cypresstester/node_modules/.bin/cypress","verify"]
2020-03-12T23:15:48.481Z cypress:cli NODE_OPTIONS is not set
2020-03-12T23:15:48.481Z cypress:cli:cli program parsing arguments
2020-03-12T23:15:48.483Z cypress:cli parsed cli options {}
2020-03-12T23:15:48.539Z cypress:cli verifying Cypress app
2020-03-12T23:15:48.540Z cypress:cli checking environment variables
2020-03-12T23:15:48.542Z cypress:cli checking if executable exists /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress
2020-03-12T23:15:48.542Z cypress:cli Binary is executable? : true
2020-03-12T23:15:48.543Z cypress:cli binaryDir is  /home/bernard/.cache/Cypress/4.1.0/Cypress
2020-03-12T23:15:48.543Z cypress:cli Reading binary package.json from: /home/bernard/.cache/Cypress/4.1.0/Cypress/resources/app/package.json
2020-03-12T23:15:48.545Z cypress:cli Found binary version 4.1.0 installed in: /home/bernard/.cache/Cypress/4.1.0/Cypress
2020-03-12T23:15:48.545Z cypress:cli could not read binary_state.json file at "/home/bernard/.cache/Cypress/4.1.0/binary_state.json"
2020-03-12T23:15:48.545Z cypress:cli {}
2020-03-12T23:15:48.545Z cypress:cli is Verified ? undefined
2020-03-12T23:15:48.545Z cypress:cli force verify
2020-03-12T23:15:48.545Z cypress:cli running binary verification check 4.1.0
2020-03-12T23:15:48.549Z cypress:cli clearing out the verified version
2020-03-12T23:15:48.551Z cypress:cli undefined DISPLAY environment variable
2020-03-12T23:15:48.551Z cypress:cli Cypress will spawn its own Xvfb
2020-03-12T23:15:48.551Z cypress:cli needs Xvfb? true
2020-03-12T23:15:48.551Z cypress:cli Starting Xvfb
2020-03-12T23:15:48.568Z cypress:cli disabling Electron sandbox
2020-03-12T23:15:48.568Z cypress:cli running smoke test
2020-03-12T23:15:48.568Z cypress:cli using Cypress executable /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress
2020-03-12T23:15:48.568Z cypress:cli smoke test command: /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress --no-sandbox --smoke-test --ping=257
2020-03-12T23:15:48.568Z cypress:cli smoke test timeout 30000 ms
2020-03-12T23:15:49.238Z cypress:cli Smoke test failed: { Error: Command failed: /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress --no-sandbox --smoke-test --ping=257
2020-03-12T23:15:48.719Z cypress:ts Running without ts-node hook in environment "production"
2020-03-12T23:15:49.053Z cypress:server:appdata path: /home/bernard/.config/Cypress/cy/production/browsers


    at makeError (/home/bernard/dev/cypresstester/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/home/bernard/dev/cypresstester/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: null,
  stdout: '',
  stderr:
   '2020-03-12T23:15:48.719Z cypress:ts Running without ts-node hook in environment "production"\n2020-03-12T23:15:49.053Z cypress:server:appdata path: /home/bernard/.config/Cypress/cy/production/browsers\n',
  failed: true,
  signal: 'SIGSEGV',
  cmd:
   '/home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress --no-sandbox --smoke-test --ping=257',
  timedOut: false,
  killed: false }
2020-03-12T23:15:49.239Z cypress:cli error message: 2020-03-12T23:15:48.719Z cypress:ts Running without ts-node hook in environment "production"
2020-03-12T23:15:49.053Z cypress:server:appdata path: /home/bernard/.config/Cypress/cy/production/browsers

2020-03-12T23:15:49.242Z cypress:cli Stopping Xvfb

Any clues how to debug this further would be great . Things I've tried:

  • increasing the timeout in the lib/task/verify.js - this results in the same error, it just takes longer
  • setting unsetting DISPLAY (as above)
  • running the task with gdb:
 gdb ~/.cache/Cypress/4.1.0/Cypress/Cypress
GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress...(no debugging symbols found)...done.
(gdb) run --smoke-test
Starting program: /home/bernard/.cache/Cypress/4.1.0/Cypress/Cypress --smoke-test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe8cbf700 (LWP 25807)]
[New Thread 0x7fffe84be700 (LWP 25812)]
repeats....
[New Thread 0x7fffab71d700 (LWP 25931)]

Thread 120 "Cypress" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffac71f700 (LWP 25929)]
0x000055555bf3be01 in __start_google_malloc ()

Seems similar to issues: #2431 #4258 #4624

Versions

Platform: linux (Ubuntu Linux - 18.04) (kernel 4.15)
Cypress Version: 4.1.0

@bahmutov
Copy link
Contributor

bahmutov commented Mar 13, 2020 via email

@blueo
Copy link
Author

blueo commented Mar 13, 2020

Thanks - but I thought I tried that scenario the logs seem to think Xvfb was run eg the command DISPLAY= npx cypress verify gives the output above and it looks like Xvfb is running:

2020-03-12T23:15:48.551Z cypress:cli undefined DISPLAY environment variable
2020-03-12T23:15:48.551Z cypress:cli Cypress will spawn its own Xvfb
2020-03-12T23:15:48.551Z cypress:cli needs Xvfb? true
2020-03-12T23:15:48.551Z cypress:cli Starting Xvfb

ideally I would run it without Xvfb (it is a desktop system) but i may be misunderstanding how that works.

@bahmutov
Copy link
Contributor

bahmutov commented Mar 13, 2020 via email

@bahmutov
Copy link
Contributor

@blueo can you try running different versions of Cypress? Like 3.8.3, 4.0.1, maybe older 3.4.1?

@blueo
Copy link
Author

blueo commented Mar 13, 2020

Sure can, this is from 3.6.1:
DEBUG=cypress:* npx cypress verify >output.txt 2>outputerr.txt

It looks like this is your first time using Cypress: 3.6.1

�[?25l[15:53:58]  Verifying Cypress can run /home/bernard/.cache/Cypress/3.6.1/Cypress [started]
[15:54:28]  Verifying Cypress can run /home/bernard/.cache/Cypress/3.6.1/Cypress [failed]
[15:54:28] → Cypress verification timed out.

This command failed with the following output:

/home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress --no-sandbox --smoke-test --ping=139

----------

2020-03-13T02:53:58.919Z cypress:ts Running without ts-node hook in environment "production"
2020-03-13T02:53:58.981Z cypress:server:cypress starting cypress with argv [ '/home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=139' ]

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.6.1
�[?25hCypress verification timed out.

This command failed with the following output:

/home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress --no-sandbox --smoke-test --ping=139

----------

2020-03-13T02:53:58.919Z cypress:ts Running without ts-node hook in environment "production"
2020-03-13T02:53:58.981Z cypress:server:cypress starting cypress with argv [ '/home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=139' ]

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.6.1
�[?25h

and

2020-03-13T02:53:58.721Z cypress:cli cli starts with arguments ["/home/bernard/.nvm/versions/node/v10.19.0/bin/node","/home/bernard/dev/tourism/tourism1/node_modules/.bin/cypress","verify"]
2020-03-13T02:53:58.722Z cypress:cli NODE_OPTIONS is not set
2020-03-13T02:53:58.723Z cypress:cli program parsing arguments
2020-03-13T02:53:58.724Z cypress:cli parsed cli options {}
2020-03-13T02:53:58.753Z cypress:cli verifying Cypress app
2020-03-13T02:53:58.753Z cypress:cli checking environment variables
2020-03-13T02:53:58.756Z cypress:cli checking if executable exists /home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress
2020-03-13T02:53:58.757Z cypress:cli Binary is executable? : true
2020-03-13T02:53:58.757Z cypress:cli binaryDir is  /home/bernard/.cache/Cypress/3.6.1/Cypress
2020-03-13T02:53:58.757Z cypress:cli Reading binary package.json from: /home/bernard/.cache/Cypress/3.6.1/Cypress/resources/app/package.json
2020-03-13T02:53:58.761Z cypress:cli Found binary version 3.6.1 installed in: /home/bernard/.cache/Cypress/3.6.1/Cypress
2020-03-13T02:53:58.762Z cypress:cli could not read binary_state.json file
2020-03-13T02:53:58.762Z cypress:cli {}
2020-03-13T02:53:58.762Z cypress:cli is Verified ? undefined
2020-03-13T02:53:58.762Z cypress:cli force verify
2020-03-13T02:53:58.762Z cypress:cli running binary verification check 3.6.1
2020-03-13T02:53:58.766Z cypress:cli clearing out the verified version
2020-03-13T02:53:58.767Z cypress:cli DISPLAY environment variable is set to :0 on Linux
Assuming this DISPLAY points at working X11 server,
Cypress will not spawn own Xvfb

NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
  see https://github.com/cypress-io/cypress/issues/4034
Solution: Unset the DISPLAY variable and try again:
  DISPLAY= npx cypress run ...
2020-03-13T02:53:58.767Z cypress:cli needs Xvfb? false
2020-03-13T02:53:58.767Z cypress:cli spawning, should retry on display problem? true
2020-03-13T02:53:58.768Z cypress:cli disabling Electron sandbox
2020-03-13T02:53:58.768Z cypress:cli running smoke test
2020-03-13T02:53:58.768Z cypress:cli using Cypress executable /home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress
2020-03-13T02:53:58.768Z cypress:cli smoke test command: /home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress --no-sandbox --smoke-test --ping=139
2020-03-13T02:53:58.768Z cypress:cli smoke test timeout 30000 ms
2020-03-13T02:54:28.790Z cypress:cli Smoke test failed: { Error: Command failed: /home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress --no-sandbox --smoke-test --ping=139
2020-03-13T02:53:58.919Z cypress:ts Running without ts-node hook in environment "production"
2020-03-13T02:53:58.981Z cypress:server:cypress starting cypress with argv [ '/home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=139' ]


    at makeError (/home/bernard/dev/tourism/tourism1/node_modules/cypress/node_modules/execa/index.js:172:9)
    at Promise.all.then.arr (/home/bernard/dev/tourism/tourism1/node_modules/cypress/node_modules/execa/index.js:277:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: null,
  stdout: '',
  stderr:
   '2020-03-13T02:53:58.919Z cypress:ts Running without ts-node hook in environment "production"\n2020-03-13T02:53:58.981Z cypress:server:cypress starting cypress with argv [ \'/home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress\', \'--no-sandbox\', \'--smoke-test\', \'--ping=139\' ]\n',
  failed: true,
  signal: 'SIGTERM',
  cmd:
   '/home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress --no-sandbox --smoke-test --ping=139',
  timedOut: true,
  killed: true }
2020-03-13T02:54:28.791Z cypress:cli error message: 2020-03-13T02:53:58.919Z cypress:ts Running without ts-node hook in environment "production"
2020-03-13T02:53:58.981Z cypress:server:cypress starting cypress with argv [ '/home/bernard/.cache/Cypress/3.6.1/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=139' ]

2020-03-13T02:54:28.791Z cypress:cli error timedOut is true

I've also verified that my display var :0 works for other applications as xset -q output looks good.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Mar 16, 2020
@jennifer-shehane
Copy link
Member

You will have to unset the DISPLAY variable as specified in the error message for Cypress to work. See #4034

2020-03-13T02:53:58.767Z cypress:cli DISPLAY environment variable is set to :0 on Linux
Assuming this DISPLAY points at working X11 server,
Cypress will not spawn own Xvfb

NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
  see https://github.com/cypress-io/cypress/issues/4034
Solution: Unset the DISPLAY variable and try again:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants