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

Cannot run Cypress on Ubuntu 18.04 #6212

Closed
tgrander opened this issue Jan 21, 2020 · 10 comments
Closed

Cannot run Cypress on Ubuntu 18.04 #6212

tgrander opened this issue Jan 21, 2020 · 10 comments
Labels
OS: linux type: duplicate This issue or pull request already exists

Comments

@tgrander
Copy link

Current behavior:

Screen Shot 2020-01-21 at 3 13 59 PM

I run npm install in my git repo, install all Cypress dependencies with apt-get, and run npx cypress run. The error above is shown.

Desired behavior:

Cypress can be opened and ran

Test code to reproduce

Install Cypress on Ubuntu 18.04 and try to run it

Versions

Cypress Version : 3.8.2
OS : Ubuntu 18.04.3
Browser : Chrome

@jennifer-shehane
Copy link
Member

There are updated instructions on the required dependencies in our docs here: https://on.cypress.io/guides/guides/continuous-integration#Dependencies

Can you verify you have installed all listed dependencies then run cypress verify in debug mode mode and print the entire set of logs here?

@cypress-bot cypress-bot bot added the stage: awaiting response Potential fix was proposed; awaiting response label Jan 22, 2020
@jin60641
Copy link

jin60641 commented Jan 22, 2020

There are updated instructions on the required dependencies in our docs here: https://on.cypress.io/guides/guides/continuous-integration#Dependencies

Can you verify you have installed all listed dependencies then run cypress verify in debug mode mode and print the entire set of logs here?

Thanks for reply! But the link you gave is not valid. I think that was https://on.cypress.io/guides/guides/continuous-integration.html#Dependencies (.html was missing)

@tgrander
Copy link
Author

I have installed all listed dependencies. My first screenshot here captures that.

Running DEBUG=cypress:* npx cypress verify prints the following:

Screen Shot 2020-01-22 at 8 52 11 AM

The error message from Cypress is not helpful at all. It is just Command failed: /home/ubuntu/.cache/Cypress/3.8.2/Cypress/Cypress --no-sandbox --smoke-test --ping=26

If I run the command that failed, /home/ubuntu/.cache/Cypress/3.8.2/Cypress/Cypress --no-sandbox --smoke-test --ping=26, then I get the message: (Cypress:20557): Gtk-WARNING **: 13:54:26.751: cannot open display:

@tgrander
Copy link
Author

tgrander commented Jan 22, 2020

Update: if I do brew cask install xquartz on my machine then I am able to ssh into the Ubuntu machine using the -X arg and successfully do cypress run. However this will not work in the CI environment because the ssh'd Ubuntu machine is relying on my local machine to run the GUI. This seems like a problem with Cypress.

It seems like there is a dependency missing for running the GUI in Ubuntu. I have installed all dependencies listed in the Cypress docs. Is there any dependency for the GUI that is missing from that list?

@tgrander
Copy link
Author

UPDATE: it works fine on Ubuntu 16, which leads me to believe that Cypress is incompatible with Ubuntu 18

@flotwig
Copy link
Contributor

flotwig commented Jan 22, 2020

Hey @tgrander, I am running & developing Cypress on Ubuntu 19.10, I'd be surprised if it was incompatible with 18.04. It seems like something is wrong with your X setup, do you use Wayland or X normally?

@flotwig
Copy link
Contributor

flotwig commented Jan 22, 2020

Normally, in CI, Cypress uses xvfb to set up a virtual framebuffer, so you don't need to do the X situation you're describing. It only does this if the DISPLAY environment variable is blank, so does running DISPLAY= npx cypress run work for you @tgrander ?

@tgrander
Copy link
Author

@flotwig I'm not using X at all on either the Ubuntu 16.04 or the 18.04 machine and yet it does work on 16.04

I tried running DISPLAY= npx cypress run on 18.04 and that does not work either

@flotwig
Copy link
Contributor

flotwig commented Jan 22, 2020

@flotwig I'm not using X at all on either the Ubuntu 16.04 or the 18.04 machine and yet it does work on 16.04

I tried running DISPLAY= npx cypress run on 18.04 and that does not work either

Yeah bizarre, I was able to reproduce this locally by running Ubuntu 18.04 in Docker.

Wrapping it in xvfb should work as a workaround (worked for me), try this: xvfb-run npx cypress run

@bahmutov
Copy link
Contributor

This is a duplicate of #6184 see temp workaround #6184 (comment)

A fix has been merged in #6199 and will be released in 3.8.3

@bahmutov bahmutov added type: duplicate This issue or pull request already exists external: xvfb OS: linux and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jan 22, 2020
@cypress-io cypress-io locked as off-topic and limited conversation to collaborators Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
OS: linux type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants