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

Cypress 3.1.1 hangs on Jenkins #2821

Closed
smartmike opened this issue Nov 21, 2018 · 8 comments
Closed

Cypress 3.1.1 hangs on Jenkins #2821

smartmike opened this issue Nov 21, 2018 · 8 comments

Comments

@smartmike
Copy link

When trying to start Cypress on Jenkins inside a cypress docker container it spins forever when verifying, the debug looks like:

["/usr/local/bin/node","/var/jenkins/workspace/.../node_modules/.bin/cypress","run","--project","./..."]
2018-11-21T16:18:09.710Z cypress:cli NODE_OPTIONS is not set
2018-11-21T16:18:09.710Z cypress:cli program parsing arguments
2018-11-21T16:18:09.711Z cypress:cli running Cypress
2018-11-21T16:18:09.744Z cypress:cli parsed cli options { project: './...' }
2018-11-21T16:18:09.746Z cypress:cli verifying Cypress app
2018-11-21T16:18:09.746Z cypress:cli Using CYPRESS_CACHE_FOLDER from environment variable
2018-11-21T16:18:09.746Z cypress:cli Using CYPRESS_CACHE_FOLDER from environment variable
2018-11-21T16:18:09.746Z cypress:cli using environment variable CYPRESS_CACHE_FOLDER cypress-cache
2018-11-21T16:18:09.746Z cypress:cli checking environment variables
2018-11-21T16:18:09.758Z cypress:cli checking if executable exists /path/to/cache/cypress-cache/3.1.1/Cypress/Cypress
2018-11-21T16:18:09.760Z cypress:cli Binary is executable? : true
2018-11-21T16:18:09.760Z cypress:cli binaryDir is  /path/to/cache/cypress-cache/3.1.1/Cypress
2018-11-21T16:18:09.760Z cypress:cli Reading binary package.json from: /path/to/cache/cypress-cache/3.1.1/Cypress/resources/app/package.json
2018-11-21T16:18:09.762Z cypress:cli Found binary version 3.1.1 installed in: /path/to/cache/cypress-cache/3.1.1/Cypress
2018-11-21T16:18:09.763Z cypress:cli could not read binary_state.json file
2018-11-21T16:18:09.763Z cypress:cli {}
2018-11-21T16:18:09.763Z cypress:cli is Verified ? undefined
2018-11-21T16:18:09.763Z cypress:cli running binary verification check 3.1.1
It looks like this is your first time using Cypress: 3.1.1

�[?25l[16:18:09]  Verifying Cypress can run /path/to/cache/cypress-cache/3.1.1/Cypress [started]
2018-11-21T16:18:09.766Z cypress:cli clearing out the verified version
2018-11-21T16:18:09.767Z cypress:cli running smoke test
2018-11-21T16:18:09.767Z cypress:cli using Cypress executable /path/to/cache/cypress-cache/3.1.1/Cypress/Cypress
2018-11-21T16:18:09.767Z cypress:cli needs XVFB? true
2018-11-21T16:18:09.767Z cypress:cli Starting XVFB
2018-11-21T16:18:09.837Z cypress:xvfb _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.

2018-11-21T16:18:09.838Z cypress:cli smoke test command: /path/to/cache/cypress-cache/3.1.1/Cypress/Cypress --smoke-test --ping=708

I've been through all the workarounds in #819 but with no luck. I'm not sure how to debug this further, any help would be appreciated.

@smartmike smartmike changed the title Cypress ^3.1.1 hangs on Jenkins Cypress 3.1.1 hangs on Jenkins Nov 21, 2018
@stickycode
Copy link

stickycode commented Nov 23, 2018

I can confirm the same behaviour, i'm using 3.1.0 and the jenkins is on kube. Running the same image locally works fine.

+ HOME=/home/node DEBUG=cypress:* /opt/cypress/node_modules/.bin/cypress run
2018-11-23T03:52:12.912Z cypress:cli cli starts with arguments ["/usr/local/bin/node","/opt/cypress/node_modules/.bin/cypress","run"]
2018-11-23T03:52:12.913Z cypress:cli NODE_OPTIONS is not set
2018-11-23T03:52:12.914Z cypress:cli program parsing arguments
2018-11-23T03:52:12.914Z cypress:cli running Cypress
2018-11-23T03:52:12.968Z cypress:cli parsed cli options {}
2018-11-23T03:52:12.969Z cypress:cli verifying Cypress app
2018-11-23T03:52:12.970Z cypress:cli checking environment variables
2018-11-23T03:52:12.990Z cypress:cli checking if executable exists /home/node/.cache/Cypress/3.1.0/Cypress/Cypress
2018-11-23T03:52:12.993Z cypress:cli Binary is executable? : true
2018-11-23T03:52:12.994Z cypress:cli binaryDir is  /home/node/.cache/Cypress/3.1.0/Cypress
2018-11-23T03:52:12.994Z cypress:cli Reading binary package.json from: /home/node/.cache/Cypress/3.1.0/Cypress/resources/app/package.json
2018-11-23T03:52:12.997Z cypress:cli Found binary version 3.1.0 installed in: /home/node/.cache/Cypress/3.1.0/Cypress
2018-11-23T03:52:12.998Z cypress:cli could not read binary_state.json file
2018-11-23T03:52:12.999Z cypress:cli {}
2018-11-23T03:52:12.999Z cypress:cli is Verified ? undefined
2018-11-23T03:52:12.999Z cypress:cli running binary verification check 3.1.0
It looks like this is your first time using Cypress: 3.1.0

[03:52:13]  Verifying Cypress can run /home/node/.cache/Cypress/3.1.0/Cypress [started]
2018-11-23T03:52:13.004Z cypress:cli clearing out the verified version
2018-11-23T03:52:13.005Z cypress:cli running smoke test
2018-11-23T03:52:13.005Z cypress:cli using Cypress executable /home/node/.cache/Cypress/3.1.0/Cypress/Cypress
2018-11-23T03:52:13.005Z cypress:cli needs XVFB? true
2018-11-23T03:52:13.005Z cypress:cli Starting XVFB
2018-11-23T03:52:13.064Z cypress:xvfb _XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

2018-11-23T03:52:13.071Z cypress:cli smoke test command: /home/node/.cache/Cypress/3.1.0/Cypress/Cypress --smoke-test --ping=589

@smartmike
Copy link
Author

Sorry to bump this, but can anyone point me in a direction to help debug this further?

@stickycode
Copy link

stickycode commented Dec 1, 2018

So it turns out that I had changed the USER to node that does not seem to work. Leave it as root.

I tried lots of different combinations so if you figure out the right permissions let me know, I don't like running it as root.

@jennifer-shehane
Copy link
Member

You may want to check on this issue concerning root access: #1281

@smartmike
Copy link
Author

Thanks @jennifer-shehane – setting ["HOME=${pwd()}/cache", "CYPRESS_CACHE_FOLDER=${pwd()}/cache"] as environment variables got it running, albeit without a cache across builds :)

@jvavre
Copy link

jvavre commented Feb 28, 2022

Thanks @jennifer-shehane – setting ["HOME=${pwd()}/cache", "CYPRESS_CACHE_FOLDER=${pwd()}/cache"] as environment variables got it running, albeit without a cache across builds :)

This fixed cypress-io/cypress-docker-images#555 for us, for reference.

@gargshashank0107
Copy link

@jennifer-shehane @jvavre can you let me know how you set these parameters in ur docker file

@jvavre
Copy link

jvavre commented Mar 10, 2022

@jennifer-shehane @jvavre can you let me know how you set these parameters in ur docker file

See my reply in cypress-io/cypress-docker-images#555

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

5 participants