Cypress: Cypress 3.1.1 hangs on Jenkins

Created on 21 Nov 2018  路  5Comments  路  Source: cypress-io/cypress

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.

Most helpful comment

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

All 5 comments

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

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

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.

You may want to check on this issue concerning root access: https://github.com/cypress-io/cypress/issues/1281

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brian-mann picture brian-mann  路  3Comments

egucciar picture egucciar  路  3Comments

zbigniewkalinowski picture zbigniewkalinowski  路  3Comments

carloscheddar picture carloscheddar  路  3Comments

tahayk picture tahayk  路  3Comments