Cypress keeps "Verifying Cypress can run", so the program hangs
Cypress to run normally
npm install cypress mocha mocha-multi-reporters mocha-junit-reporter
node_modules/cypress/bin/cypress verify
No, are there log files somewhere?
If you hit problems running Cypress on a specific system:
DEBUG=cypress:cli,xvfb npx cypress verify
provide an example for us to reproduce, and please remember that it will be hard for us to install an entire system that matches your system unless you provide Docker file
Operating System: CentOS 7.4
Can you run verify step with DEBUG=cypress:*
environment variable so we see debug log messages, please?
Not much more to see:
cypress:cli cli starts with arguments ["/usr/bin/node","/opt/webtest/node_modules/cypress/bin/cypress","verify"] +0ms
cypress:cli verifying Cypress app +202ms
cypress:cli path to info.json file /opt/webtest/node_modules/cypress/dist/info.json +3ms
cypress:cli { version: '1.0.2', verifiedVersion: null } +6ms
cypress:cli installed version is 1.0.2 comparing to 1.0.2 +4ms
cypress:cli checking if executable exists /opt/webtest/node_modules/cypress/dist/Cypress/Cypress +0ms
cypress:cli path to info.json file /opt/webtest/node_modules/cypress/dist/info.json +1ms
cypress:cli has verified version null +1ms
cypress:cli run verification check? true +0ms
cypress:cli running binary verification check 1.0.2 +1ms
It looks like this is your first time using Cypress: 1.0.2
cypress:cli writing verified version string "null" +6ms
cypress:cli path to info.json file /opt/webtest/node_modules/cypress/dist/info.json +0ms
cypress:cli path to info.json file /opt/webtest/node_modules/cypress/dist/info.json +1ms
cypress:cli running smoke test +6ms
cypress:cli using Cypress executable /opt/webtest/node_modules/cypress/dist/Cypress/Cypress +0ms
cypress:cli needs XVFB? true +0ms
cypress:cli Starting XVFB +1ms
⠏ Verifying Cypress can run /opt/webtest/node_modules/cypress/dist/Cypress
Note that the icon keeps spinning, so it is not completely frozen..
Not sure if same problem but the same happens
One issue I had during installation is that I could not find libsound package and I had to install libsound2
Operating System: Ubuntu 16.04.3 LTS (under windows 10)
Cypress Version: 1.0.2
```root@Marchy:/mnt/c/git/test-cypress# DEBUG=cypress:* node_modules/cypress/bin/cypress verify
cypress:cli cli starts with arguments ["/root/.nvm/versions/node/v8.8.1/bin/node","/mnt/c/git/test-cypress/node_modules/cypress/bin/cypress","verify"] +0ms
cypress:cli verifying Cypress app +205ms
cypress:cli path to info.json file /mnt/c/git/test-cypress/node_modules/cypress/dist/info.json +1ms
cypress:cli { version: '1.0.2', verifiedVersion: null } +14ms
cypress:cli installed version is 1.0.2 comparing to 1.0.2 +2ms
cypress:cli checking if executable exists /mnt/c/git/test-cypress/node_modules/cypress/dist/Cypress/Cypress +0ms
cypress:cli path to info.json file /mnt/c/git/test-cypress/node_modules/cypress/dist/info.json +1ms
cypress:cli has verified version null +1ms
cypress:cli run verification check? true +0ms
cypress:cli running binary verification check 1.0.2 +0ms
It looks like this is your first time using Cypress: 1.0.2
cypress:cli writing verified version string "null" +3ms
cypress:cli path to info.json file /mnt/c/git/test-cypress/node_modules/cypress/dist/info.json +0ms
cypress:cli path to info.json file /mnt/c/git/test-cypress/node_modules/cypress/dist/info.json +1ms
cypress:cli running smoke test +4ms
cypress:cli using Cypress executable /mnt/c/git/test-cypress/node_modules/cypress/dist/Cypress/Cypress +0ms
cypress:cli needs XVFB? true +0ms
cypress:cli Starting XVFB +0ms
cypress:cli smoke test command: /mnt/c/git/test-cypress/node_modules/cypress/dist/Cypress/Cypress --smoke-test --ping=390 +62ms
⠙ Verifying Cypress can run /mnt/c/git/test-cypress/node_modules/cypress/dist/Cypress```
The docs have been updated to specify libsound2
instead of libsound
package now: https://on.cypress.io/continuous-integration#Dependencies
@jennifer-shehane Does that have anything to do with these bug reports?
P.S. libasound.so.2
is installed on my system.
@Hipska what happens if you just install cypress and then start adding dependencies one by one to see which one breaks?
npm i cypress
$(npm bin)/cypress verify
npm i mocha
$(npm bin)/cypress verify
npm i mocha-multi-reporters
$(npm bin)/cypress verify
npm i mocha-junit-reporter
$(npm bin)/cypress verify
The second line already keeps Cypress hanging. So only installing Cypress already breaks.
so if I run
npm i cypress
$(npm bin)/cypress verify
on CentOS 7.4
it is hanging, right? I am just trying to confirm the smallest reproduction steps
Yup exactly, and apparently on Ubuntu 16.04.3 as well.
@Hipska I made a (larger than necessary) Docker image based on Centos7 cypress/base:centos7
if you want to give this a spin. The dockerfile with dependencies I had to install there is https://github.com/cypress-io/cypress-docker-images/blob/centos7/Dockerfile
See if these dependencies / image solves your problem
Hi, any updates on this issue? I can't manage to run tests on Jenkins, although locally everything is working perfectly. Tried the above mentioned build as well, got same result:
It looks like this is your first time using Cypress: 1.4.1 [00:08:19]
Verifying Cypress can run /var/lib/jenkins/workspace/st_addCypress-docker-centos-CCQQYACIT2KYV7T2RMNHRIYTIIIJXPZF2NFPS76PZKAIDRAPJLFA/node_modules/cypress/dist/Cypress [started]
[00:22:59] Verifying Cypress can run /var/lib/jenkins/workspace/st_addCypress-docker-centos-CCQQYACIT2KYV7T2RMNHRIYTIIIJXPZF2NFPS76PZKAIDRAPJLFA@2/node_modules/cypress/dist/Cypress [started]
2018-01-14T00:22:59.450Z cypress:cli writing verified version string "null"
2018-01-14T00:22:59.451Z cypress:cli path to info.json file /var/lib/jenkins/workspace/st_addCypress-docker-centos-CCQQYACIT2KYV7T2RMNHRIYTIIIJXPZF2NFPS76PZKAIDRAPJLFA@2/node_modules/cypress/dist/info.json
2018-01-14T00:22:59.451Z cypress:cli path to info.json file /var/lib/jenkins/workspace/st_addCypress-docker-centos-CCQQYACIT2KYV7T2RMNHRIYTIIIJXPZF2NFPS76PZKAIDRAPJLFA@2/node_modules/cypress/dist/info.json
2018-01-14T00:22:59.455Z cypress:cli running smoke test
2018-01-14T00:22:59.455Z cypress:cli using Cypress executable /var/lib/jenkins/workspace/st_addCypress-docker-centos-CCQQYACIT2KYV7T2RMNHRIYTIIIJXPZF2NFPS76PZKAIDRAPJLFA@2/node_modules/cypress/dist/Cypress/Cypress
2018-01-14T00:22:59.455Z cypress:cli needs XVFB? true
2018-01-14T00:22:59.455Z cypress:cli Starting XVFB
2018-01-14T00:22:59.509Z cypress:cli smoke test command: /var/lib/jenkins/workspace/st_addCypress-docker-centos-CCQQYACIT2KYV7T2RMNHRIYTIIIJXPZF2NFPS76PZKAIDRAPJLFA@2/node_modules/cypress/dist/Cypress/Cypress --smoke-test --ping=11
I tried also running explicitly xvfb-run -a -s "-screen 0 1280x1024x24" {path to Cypress} --run-project={path to project}
and get:
Xlib: extension "RANDR" missing on display ":99".
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Path must be absolute
at Error (native)
at Object.<anonymous> (/projectpath/node_modules/cypress/dist/Cypress/resources/electron.asar/browser/init.js:150:5)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:402:7)
at startup (bootstrap_node.js:157:9)
Xlib: extension "RANDR" missing on display ":99".
libudev: udev_has_devtmpfs: name_to_handle_at on /dev: Operation not permitted
hi @bahmutov, tried the docker image and didn't solved the issue. when i ran DEBUG='cypress:* ./node_modules/cypress/bin/cypress verify it still hangs on the smoke test command.
Any updates on this issue? anyone :)
I'm having the same problem running the Docker image. Let me know if I can give valuable info.
Is there any update regarding this problem?
Are we talking about it hanging only in CentOS
?
@floriansimon1 which docker image are you running?
@bramsierag which docker image are you running?
cypress/base:8
cypress/base:centos7
@floriansimon1 okay it sounds like then you're having a problem running in Ubuntu
. Honestly, I have no idea - we have so many users using this image, and we internally use it across many different services - local docker in OSX, multiple CI providers - I can't imagine what could not be working with yours. Perhaps it's something to do with your Docker configuration. I would say simplify everything - get rid of your docker configuration and just try to get Cypress up and running by itself. From there start adding in things until it stops working. Run locally too, not in CI. Remove everything that's your own configuration and start with the image by itself. Mount it locally and run it.
@bramsierag let me see if we can get some 👀 into this. @Bkucera do you mind taking the lead on this one? @bramsierag is saying the verification stage of Cypress is failing on our docker centos image. Can you reproduce locally and then I'll help you take a look at it. Thanks.
It might help if the verify step would output some debug info instead of just “doing stuff”.
@brian-mann: thanks for your answer. If it helps, the image works locally. It only fails on my Jenkins server. I tried using the CentOS image on Jenkins, and I got the same results. It might be due to the Jenkins Docker config, but I don't have the liberty/knowledge to change it unfortunately, so I'll wait for the Cypress team to fix @bramsierag's problem and update, hoping that it will resolve my problem as well.
I guess I'll have to disable the test suite on the CI server for now :-/
EDIT: My version of Docker on Jenkins is Docker version 17.12, and I have 17.05 locally.
@bramsierag where are you running your docker image? I am not having any errors with any of the docker images with any Cypress versions running docker locally(on Linux) , it would be helpful to know your CI provider
Hi Bkucera, appreciate the effort. Locally on osx no problem, only with Jenkins on centos7. Docker version local and on centos is 17.12
@bramsierag alright, looks like I'm gonna have to spin up Docker inside Jenkins inside Docker to see whats going on
I just reran the tests with debug mode and it seems that it also hangs on the smoke-test line. The difference is that I have the following:
2018-02-26T10:30:39.601Z cypress:cli using Cypress executable /foobar/workspace/node_modules/cypress/dist/Cypress/Cypress
2018-02-26T10:30:39.601Z cypress:cli needs XVFB? true
2018-02-26T10:30:39.601Z cypress:cli Starting XVFB
2018-02-26T10:30:39.644Z cypress:xvfb _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
Error :
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.
----------
/root/node_modules/cypress/dist/Cypress/Cypress: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
----------
Platform: linux (Centos - 7.4.1708)
Cypress Version: 2.1.0
installing works for me :
$ yum provides */libgconf-2.so.4
$ yum install GConf2
It looks like this is your first time using Cypress: 2.1.0
✔ Verified Cypress! /root/node_modules/cypress/dist/Cypress
Is this related to our problems?
I encountered that we have to install these packages to make this work on our Jenkins slaves so probably not directly same problem but providing the solution which worked for us on Centos 7+ version .
Hope it helps.
Thanks you for your help. I'll try that, see if that resolves our problem. I'm a bit unsure it will though, because I'm using the Docker images which supposedly include dependencies.
We never know, it's worth giving it a shot! Thanks!
I am not sure about the docker image but I think you can do
docker exec -it
To connect to it and run above commands to just validate cypress verify etc.
Hello!
I'm running in to the same "Cypress is hanging on Jenkins" issue. I canceled the build after letting it run for 27 minutes (normally takes 2 minutes)
Jenkins: v2.103
OS: Using the Cypress/browsers:chrome63-ff57 Docker image
Cypres: v2.1.0
Here are some logs (collected with DEBUG=cypress:*
as instructed above)
[s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ] Running shell script
+ npm run e2e:headless
> [email protected] e2e:headless /var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ
> cypress run
2018-03-30T15:27:41.325Z cypress:cli cli starts with arguments ["/usr/local/bin/node","/var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ/node_modules/.bin/cypress","run"]
2018-03-30T15:27:41.327Z cypress:cli program parsing arguments
2018-03-30T15:27:41.329Z cypress:cli running Cypress
2018-03-30T15:27:41.529Z cypress:cli parsed cli options {}
2018-03-30T15:27:41.532Z cypress:cli verifying Cypress app
2018-03-30T15:27:41.532Z cypress:cli path to info.json file /var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ/node_modules/cypress/dist/info.json
2018-03-30T15:27:41.539Z cypress:cli { version: '2.1.0' }
2018-03-30T15:27:41.540Z cypress:cli installed version is 2.1.0 comparing to 2.1.0
2018-03-30T15:27:41.540Z cypress:cli checking if executable exists /var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ/node_modules/cypress/dist/Cypress/Cypress
2018-03-30T15:27:41.542Z cypress:cli path to info.json file /var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ/node_modules/cypress/dist/info.json
2018-03-30T15:27:41.542Z cypress:cli has verified version undefined
2018-03-30T15:27:41.543Z cypress:cli run verification check? true
2018-03-30T15:27:41.544Z cypress:cli running binary verification check 2.1.0
It looks like this is your first time using Cypress: 2.1.0
[15:27:41] Verifying Cypress can run /var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ/node_modules/cypress/dist/Cypress [started]
2018-03-30T15:27:41.553Z cypress:cli writing verified version string "null"
2018-03-30T15:27:41.553Z cypress:cli path to info.json file /var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ/node_modules/cypress/dist/info.json
2018-03-30T15:27:41.555Z cypress:cli path to info.json file /var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ/node_modules/cypress/dist/info.json
2018-03-30T15:27:41.558Z cypress:cli running smoke test
2018-03-30T15:27:41.558Z cypress:cli using Cypress executable /var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ/node_modules/cypress/dist/Cypress/Cypress
2018-03-30T15:27:41.558Z cypress:cli needs XVFB? true
2018-03-30T15:27:41.558Z cypress:cli Starting XVFB
2018-03-30T15:27:42.247Z cypress:xvfb _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
2018-03-30T15:27:42.370Z cypress:cli smoke test command: /var/lib/jenkins/workspace/s-pipeline_jenkins-pipeline-G2UOUKJEDP3BLHOOOFNM35RUHBROTE7EGGL4FSL2SDPF4ATJEAKQ/node_modules/cypress/dist/Cypress/Cypress --smoke-test --ping=996
Sending interrupt signal to process
Sending interrupt signal to process
Terminated
script returned exit code 143
Anything new with this? I'm getting a similar output with cypress/browsers:chrome65-ff57
```It looks like this is your first time using Cypress: 2.1.0
[?25l[16:42:08] Verifying Cypress can run /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/Cypress [started]
2018-05-04T16:42:08.277Z cypress:cli writing verified version string "null"
2018-05-04T16:42:08.277Z cypress:cli path to info.json file /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/info.json
2018-05-04T16:42:08.278Z cypress:cli path to info.json file /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/info.json
2018-05-04T16:42:08.281Z cypress:cli running smoke test
2018-05-04T16:42:08.281Z cypress:cli using Cypress executable /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/Cypress/Cypress
2018-05-04T16:42:08.281Z cypress:cli needs XVFB? true
2018-05-04T16:42:08.281Z cypress:cli Starting XVFB
2018-05-04T16:42:08.373Z cypress:xvfb _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
2018-05-04T16:42:08.379Z cypress:cli smoke test command: /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/Cypress/Cypress --smoke-test --ping=703```
No nothing new, it looks like they are ignoring my and others issue. So I'm ignoring Cypress as well and moved to other tools.
I know this can be frustrating, but please try to refrain from making any such witty comments. The Cypress team does not owe us anything. If you aren't happy with the fact that this isn't getting anywhere, why don't you just try to find a fix yourself? OSS needs your contributions, it's not just a shop for software that is free of charge.
True, but in the same way, I'm also not obliged to continue using this tool.
I made the suggestion to add more debug info or logging in the verify step, but to no success.. When that could be included, I might be able to pinpoint the problem more. And eventually, maybe also fix it.
@morficus @paulmoliva I've seen a few different ways of people using Jenkins with Cypress, including mounting the entire project directory (including node_modules) in a docker container, and having the container execute cypress run
(which I am pretty sure does NOT work). Could you explain briefly how you configured Jenkins?
edit: too many pauls
@paulmoliva ☝️
pipeline {
agent {
label 'web-apps-node'
}
environment {
JAVA_HOME = '/usr/java/latest'
DEBUG = 'cypress:*'
}
stages {
stage('Clean Workspace') {
steps {
sh 'echo $JAVA_HOME'
sh 'unset JAVA_HOME'
sh 'echo $JAVA_HOME'
}
}
stage('UI Build') {
agent {
docker {
image 'cypress/base:8'
label 'web-apps-node'
}
}
steps {
sh 'node --version'
sh 'yarn install'
sh 'yarn cypress:run'
}
}
stage('Build') {
agent {
docker {
image 'maven:3'
label 'web-apps-node'
args '-v $HOME/.m2:/root/.m2'
}
}
steps {
sh 'echo $JAVA_HOME'
sh 'mvn -v'
sh 'mvn -U clean deploy'
}
}
}
}
The node we're running it on is an EC2 instance with Amazon Linux.
@Bkucera
:smile: I was just accidentally @mentioned. No need to include me
@paulmoliva @morficus the error is coming from here. https://github.com/cypress-io/xvfb/blob/605d95236a63516737c0483ae6e8a5cf559cf1cc/index.js#L215
Which looks unique to the other issues. This could be specific to Amazon Linux.
I'm running Jenkins on a plain old Debian box configured in-house, and I have the same issue, so definitely not only an Amazon Linux-related error
@floriansimon1 are you getting _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
?
if so, can you share your Jenkins setup / Pipeline file
I misunderstood you, sorry. I thought you were mentioning the more general problem of Cypress hanging. I don't know if I have the same problem, I can't remember. I'll have a look when I get back to work next week.
Thanks for your help.
Having the same problem with Bamboo:
/node_modules/cypress/dist/Cypress/Cypress: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
----------
Platform: linux (Ubuntu Linux - 16.04)
Cypress Version: 2.1.0
@Bkucera I don't have the same error message. I don't have any actually, the only thing that I have is Cypress hanging on the verify step.
So I was able to do some hacky workaround and get rid of the _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
error, but it's still hanging. So I'm thinking that's probably not the root cause?
2018-05-22T17:05:03.758Z cypress:cli running binary verification check 2.1.0
It looks like this is your first time using Cypress: 2.1.0
[?25l[17:05:03] Verifying Cypress can run /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/Cypress [started]
2018-05-22T17:05:03.767Z cypress:cli writing verified version string "null"
2018-05-22T17:05:03.767Z cypress:cli path to info.json file /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/info.json
2018-05-22T17:05:03.768Z cypress:cli path to info.json file /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/info.json
2018-05-22T17:05:03.770Z cypress:cli running smoke test
2018-05-22T17:05:03.770Z cypress:cli using Cypress executable /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/Cypress/Cypress
2018-05-22T17:05:03.770Z cypress:cli needs XVFB? true
2018-05-22T17:05:03.770Z cypress:cli Starting XVFB
2018-05-22T17:05:03.800Z cypress:cli smoke test command: /home/ec2-user/jenkins/workspace/pps_ooe-branch_jenkins-test-ADD3QMT6D2GQ3ZNOOXURXV2H5Z7WHQNGRIFSCPHGP6CPHN5QRKXQ@2/node_modules/cypress/dist/Cypress/Cypress --smoke-test --ping=447
Is there any active investigation going on on this issue?
Does your test user have a home directory? Try [[ -d "$HOME" ]] || <
Edit: actually that wouldn't work literally, for my case, I got stuck at verification when my home directory isn't writable by the user.
@floriansimon1 @paulmoliva you'll need to upgrade to 3.0.2
and add DEBUG=cypress:*
and then paste the output. We've changed several things with installing Cypress and have added a lot more debug output.
@codyit > yes, my user has a home directory. I'll retry with Cypress 3.
I tried with Cypress 3.0.2, the log is pretty similar:
[00:37:56] Verifying Cypress can run /.cache/Cypress/3.0.2/Cypress [started]
bash-4.2$ DEBUG=cypress:* $ $(npm bin)/cypress verify
cypress:cli cli starts with arguments ["/usr/bin/node","PRIVATE_FOLDER/node_modules/.bin/cypress","verify"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli program parsing arguments +4ms
cypress:cli parsed cli options {} +2ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +2ms
cypress:cli checking if executable exists /.cache/Cypress/3.0.2/Cypress/Cypress +4ms
cypress:cli Binary is executable? : true +2ms
cypress:cli binaryDir is /.cache/Cypress/3.0.2/Cypress +1ms
cypress:cli Reading binary package.json from: /.cache/Cypress/3.0.2/Cypress/resources/app/package.json +0ms
cypress:cli Found binary version 3.0.2 installed in: /.cache/Cypress/3.0.2/Cypress +4ms
cypress:cli could not read binary_state.json file +5ms
cypress:cli {} +0ms
cypress:cli is Verified ? undefined +1ms
cypress:cli force verify +1ms
cypress:cli running binary verification check 3.0.2 +0ms
It looks like this is your first time using Cypress: 3.0.2
[00:38:09] Verifying Cypress can run /.cache/Cypress/3.0.2/Cypress [started]
cypress:cli clearing out the verified version +6ms
cypress:cli running smoke test +2ms
cypress:cli using Cypress executable /.cache/Cypress/3.0.2/Cypress/Cypress +0ms
cypress:cli needs XVFB? true +0ms
cypress:cli Starting XVFB +0ms
cypress:cli smoke test command: /.cache/Cypress/3.0.2/Cypress/Cypress --smoke-test --ping=601 +19ms
Finally found a solution!
My setup is similar to @paulmoliva.
Jenkins declarative pipeline ends up running docker like this:
docker run -t -d -u ***:*** -w /var/lib/jenkins/workspace/<JOB> -v /var/lib/jenkins/workspace/<JOB>:/var/lib/jenkins/workspace/<JOB>:rw,z -v /var/lib/jenkins/workspace/<JOB>@tmp:/var/lib/jenkins/workspace/<JOB>@tmp:rw,z -e ******** ... cypress/base:8 cat
Turns out that workspace is correct, but inside container home location is /
, and every file write happens to host's /
(Jenkins root).
Then in our specific case, electron cannot write to home location, and Cypress's smoke test crashes in hang.
The solution is to provide an HOME environment variable to docker, then all processes that uses home location reads/writes to the correct path:
agent {
docker {
image 'cypress/base:8'
args '-e HOME=${workspace}'
}
}
Note: For me args worked only with single quotes, maybe it runs a lazy evaluation instead of double quotes.
Note: With this solution I was also able to replace cypress/base:centos7 with cypress/base:8 image
@fsmaia your solution fixed the issue for me. Cheers.
what is the proper solution is by using bash command? I use the following command with linux OS:
docker run -v "$(pwd):/www/app:rw,z" -e HOME=/www/app --network="bridge" -w /www/app cypress/chrome67 /bin/bash -c "yarn install && yarn add cypress && ./node_modules/.bin/cypress run --spec test.js --browser chrome --env name=stage"
and it is stuck with the cypress verification
Log:
2018-07-26T00:23:16.520Z cypress:cli NODE_OPTIONS is not set
2018-07-26T00:23:16.521Z cypress:cli program parsing arguments
2018-07-26T00:23:16.522Z cypress:cli running Cypress
2018-07-26T00:23:16.590Z cypress:cli parsed cli options { spec: 'tests/e2e/cypress/tests/ndpCrime.test.js',
env: 'name=stage',
browser: 'chrome' }
2018-07-26T00:23:16.593Z cypress:cli verifying Cypress app
2018-07-26T00:23:16.594Z cypress:cli checking environment variables
2018-07-26T00:23:16.610Z cypress:cli checking if executable exists /root/.cache/Cypress/3.0.2/Cypress/Cypress
2018-07-26T00:23:16.613Z cypress:cli Binary is executable? : true
2018-07-26T00:23:16.613Z cypress:cli binaryDir is /root/.cache/Cypress/3.0.2/Cypress
2018-07-26T00:23:16.614Z cypress:cli Reading binary package.json from: /root/.cache/Cypress/3.0.2/Cypress/resources/app/package.json
2018-07-26T00:23:16.617Z cypress:cli Found binary version 3.0.2 installed in: /root/.cache/Cypress/3.0.2/Cypress
2018-07-26T00:23:16.618Z cypress:cli could not read binary_state.json file
2018-07-26T00:23:16.618Z cypress:cli {}
2018-07-26T00:23:16.619Z cypress:cli is Verified ? undefined
2018-07-26T00:23:16.619Z cypress:cli running binary verification check 3.0.2
[00:23:16] Verifying Cypress can run /root/.cache/Cypress/3.0.2/Cypress [started]
2018-07-26T00:23:16.625Z cypress:cli clearing out the verified version
2018-07-26T00:23:16.627Z cypress:cli running smoke test
2018-07-26T00:23:16.627Z cypress:cli using Cypress executable /root/.cache/Cypress/3.0.2/Cypress/Cypress
2018-07-26T00:23:16.627Z cypress:cli needs XVFB? true
2018-07-26T00:23:16.627Z cypress:cli Starting XVFB
2018-07-26T00:23:16.659Z cypress:cli smoke test command: /root/.cache/Cypress/3.0.2/Cypress/Cypress --smoke-test --ping=77
@fsmaia Can you help pointing out more for the solution?
@paulmoliva mind sharing the "hacky workaround" to get past the /tmp
write? Trying to recreate this fix, and I'm not sure if these are two separate issues.
@a-type It was something like this:
Dockerfile
FROM node:8.11
RUN apt-get update && \
apt-get install -y \
libgtk2.0-0 \
libnotify-dev \
libgconf-2-4 \
libnss3 \
libxss1 \
libasound2 \
xvfb \
sudo
RUN npm install [email protected] -g
# versions of local tools
RUN node -v
RUN npm -v
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
USER docker
Jenkinsfile
...
stage('UI Build') {
agent {
dockerfile {true}
label 'web-apps-node'
}
steps {
sh 'mkdir /tmp/.X11-unix'
sh 'sudo chmod 1777 /tmp/.X11-unix'
sh 'sudo chown root /tmp/.X11-unix/'
sh 'node --version'
sh 'yarn install'
sh 'yarn cypress:run'
}
}
...
Like I said... hacky workaround 🗡
Got it, we're running in OpenShift Enterprise which adds a bunch of other problems into the mix.
For anyone else who encounters such issues when trying to run a Centos-7-based image in OpenShift, we ended up finding this plugin for Jenkins, and now we just spin up an image based on the default Cypress images:
podTemplate(label: label, cloud: 'openshift', containers: [
containerTemplate(
name: 'cypress',
image: 'cypress/browsers:chrome67',
ttyEnabled: true,
command: 'cat',
resourceRequestCpu: '200m',
resourceLimitCpu: '300m',
resourceRequestMemory: '500m',
resourceLimitMemory: '2Gi',
)
]) {
node(label) {
stage('Cypress Tests') {
git url: 'https://github.com/****.git',
branch: 'master',
credentialsId: '***********'
container('cypress') {
stage('Install dependencies') {
sh 'npm install'
}
stage('Run Presentation Tests') {
sh 'npm run presentational-tests'
}
}
}
}
}
The root problem (the permissions thing) just kind of went away when we use the default images. Could have something to do with Centos, idk. We were using Centos because we were basing our image off one which included JNLP, but that does not seem necessary with the plugin.
I see a few users have offered workarounds for this problem.
Is this still an issue for anyone?
Hey guys, I'm facing the same issue on Ubuntu (WSL on windows 10) when running cypress for a first time. Any ideas? I already installed all cypress required dependencies.
LOG from DEBUG=cypress:* cypress run
cypress:cli cli starts with arguments ["/usr/bin/node","/home/fecruzb/codes/my-project/node_modules/.bin/cypress","run"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli program parsing arguments +6ms
cypress:cli running Cypress +1ms
cypress:cli parsed cli options {} +84ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +1ms
cypress:cli checking if executable exists /home/fecruzb/.cache/Cypress/3.1.0/Cypress/Cypress +5ms
cypress:cli Binary is executable? : true +10ms
cypress:cli binaryDir is /home/fecruzb/.cache/Cypress/3.1.0/Cypress +1ms
cypress:cli Reading binary package.json from: /home/fecruzb/.cache/Cypress/3.1.0/Cypress/resources/app/package.json +0ms
cypress:cli Found binary version 3.1.0 installed in: /home/fecruzb/.cache/Cypress/3.1.0/Cypress +5ms
cypress:cli could not read binary_state.json file +5ms
cypress:cli {} +1ms
cypress:cli is Verified ? undefined +2ms
cypress:cli running binary verification check 3.1.0 +0ms
It looks like this is your first time using Cypress: 3.1.0
cypress:cli clearing out the verified version +6ms
cypress:cli running smoke test +2ms
cypress:cli using Cypress executable /home/fecruzb/.cache/Cypress/3.1.0/Cypress/Cypress +0ms
cypress:cli needs XVFB? true +0ms
cypress:cli Starting XVFB +0ms
⠹ Verifying Cypress can run /home/fecruzb/.cache/Cypress/3.1.0/Cypress
⠧ Verifying Cypress can run /home/fecruzb/.cache/Cypress/3.1.0/Cypress
@jennifer-shehane – @HugoGiraudel and I are getting this running Cypress 3.1.1 inside the cypress-8 base image
[?25l[12:00:04] Verifying Cypress can run /var/jenkins/workspace/[projectpath]/cypress-cache/3.1.1/Cypress [started]
2018-11-15T12:00:04.207Z cypress:cli clearing out the verified version
2018-11-15T12:00:04.209Z cypress:cli running smoke test
2018-11-15T12:00:04.209Z cypress:cli using Cypress executable /var/jenkins/workspace/[projectpath]/cypress-cache/3.1.1/Cypress/Cypress
2018-11-15T12:00:04.209Z cypress:cli needs XVFB? true
2018-11-15T12:00:04.210Z cypress:cli Starting XVFB
2018-11-15T12:00:04.210Z xvfb lock filename /tmp/.X99-lock
2018-11-15T12:00:04.210Z xvfb lock filename /tmp/.X99-lock
2018-11-15T12:00:04.210Z xvfb setting DISPLAY :99
2018-11-15T12:00:04.214Z xvfb all Xvfb arguments [ ':99' ]
2018-11-15T12:00:04.227Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2018-11-15T12:00:04.238Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2018-11-15T12:00:04.248Z cypress:xvfb _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
2018-11-15T12:00:04.248Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2018-11-15T12:00:04.248Z xvfb lock file /tmp/.X99-lock found after 20 ms
2018-11-15T12:00:04.249Z cypress:cli smoke test command: /var/jenkins/workspace/[projectpath]/cypress-cache/3.1.1/Cypress/Cypress --smoke-test --ping=362
Couldn't get any of the workarounds above to help
Hello everyone, Im having similar problem on Ubuntu (WSL on windows 10)
adduser@Magus:/mnt/c/Users/Illya/projects/haha-studio$ DEBUG=cypress:* cypress run
cypress:cli cli starts with arguments ["/usr/bin/node","/usr/bin/cypress","run"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli program parsing arguments +9ms
cypress:cli running Cypress +3ms
cypress:cli parsed cli options {} +439ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +4ms
cypress:cli checking if executable exists /home/adduser/.cache/Cypress/3.1.1/Cypress/Cypress +82ms
cypress:cli Binary is executable? : true +56ms
cypress:cli binaryDir is /home/adduser/.cache/Cypress/3.1.1/Cypress +5ms
cypress:cli Reading binary package.json from: /home/adduser/.cache/Cypress/3.1.1/Cypress/resources/app/package.json +0ms
cypress:cli Found binary version 3.1.1 installed in: /home/adduser/.cache/Cypress/3.1.1/Cypress +15ms
cypress:cli could not read binary_state.json file +18ms
cypress:cli {} +1ms
cypress:cli is Verified ? undefined +9ms
cypress:cli running binary verification check 3.1.1 +1ms
It looks like this is your first time using Cypress: 3.1.1
cypress:cli clearing out the verified version +15ms
cypress:cli running smoke test +8ms
cypress:cli using Cypress executable /home/adduser/.cache/Cypress/3.1.1/Cypress/Cypress +1ms
cypress:cli needs XVFB? true +1ms
cypress:cli Starting XVFB +0ms
⠏ Verifying Cypress can run /home/adduser/.cache/Cypress/3.1.1/Cypress
⠼ Verifying Cypress can run /home/adduser/.cache/Cypress/3.1.1/Cypress
I am closing this issue because it became a collection of problems / solutions for a list of different systems. Please if you still have a problem open a separate issue for each platform (unless there is a matching issue for your platform already)
Er... Yeah thanks, I think... My original problem still isn't solved and I don't have answers for things I asked.
@Hipska I feel sorry that I cannot debug your exact problem, do you have a Docker image with the exact OS that is having a problem?
Having same issue on Ubuntu 16.04.5 LTS (WSL on windows 10)
We had the same problem - the reason was that "$HOME/.config" was mounted into the container read-only. So the solution was to mount the relevant stuff into another directory and then copy it over before the build.
Would be great when Cypress would not wait/hang when a file cannot be written.
Same issue
Windows 10
WSL - Ubuntu 18.04.1 LTS (Bionic Beaver)
Cypress - ^3.1.5
Steps:
npm i
node node_modules/cypress/bin/cypress open
Result: never finishes 'Verifying cypress can run'
In case it helps anyone: we had this issue with the cypress base image. But, we had environment variable NODE_OPTIONS="--max_old_space_size=2000"
set for node set in our CI. Removing this environment variable while cypress was running solved the problem.
I ran into this same problem of Cypress hanging on the verify step.
The call to util.exec
is where I observed it hanging:
If I change that first line to:
return Promise.resolve(util.exec(cypressExecPath, args, { stdio: 'inherit' }))
So that the child process dumps its stdout and stderr to those of the parent process, it still hangs but I get an informative error message:
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Failed to get 'appData' path
at Object.<anonymous> (/tmp/lib/resources/electron.asar/browser/init.js:149:39)
at Object.<anonymous> (/tmp/lib/resources/electron.asar/browser/init.js:173:3)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:167:16)
at bootstrap_node.js:589:3
Which I was able to use to trace back to the problem (same as @derkoe 's -- electron's default appData path was a read-only directory).
Y'all open to a PR to add this? Doesn't address the underlying issue of why cypress --smoke-test
seems to be not exiting when this kind of failure happens, but it at least adds visibility so folks can self-serve and fix their specific problem more easily.
EDIT would need to adjust things a little so the then
and catch
callbacks don't blow up with the difference when the smoke test does exit -- more like "y'all open to something along these lines"
Finally some progress on this ticket 👍
@stuartsan Yes, we're definitely open to PRs for this - hanging with zero errors is the absolute worst experience Cypress can give. Any improvement on this is gladly welcomed.
Feel free to open WIP PRs if you don't know how to implement and test it all also. https://github.com/cypress-io/cypress/blob/develop/CONTRIBUTING.md#writing-code
Can this issue then be reopened please?
@jennifer-shehane cool, thanks. Just sent a PR: https://github.com/cypress-io/cypress/pull/3807
While not actually testing the above PR, it did give the crucial tip to check for permissions on ~/.config/
. So this solved my cypress verify
issue.
_More debug info === more good_ ;)
The code for this is done in cypress-io/cypress#4080, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
Released in 3.3.0
.
Hi everyone!.
I tried everything I could find on the Internet to solve this issue. Spent 2 days exhausting all the suggested fixes I found. It boiled down to WSL 2, which required me to install a pre-release of Win 10 on my machine after enrolling in the insider program.
This worked for me:
Note: The legacy Ubuntu distro does not work with WSL 2.0. I added Ubuntu 18.04 through the Windows Store during _Step 2_.
jstander@DESKTOP-4UO32GL:/mnt/c/dev17/...$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
jstander@DESKTOP-4UO32GL:/mnt/c/dev17/...$ yarn cypress verify
yarn run v1.22.4
$ /mnt/c/dev17/.../node_modules/.bin/cypress verify
✔ Verified Cypress! /home/jstander/.cache/Cypress/4.5.0/Cypress
Done in 15.14s.
jstander@DESKTOP-4UO32GL:/mnt/c/dev17/...$
@justinstander Your solution is working.... :) It's very tricky to install everything but after wasting half of the day to fix this "verification" issue I've made it working on my windows with ubuntu 18.4 and wsl2. Would be faster to install an ubuntu system and install the project there to see how this will work on CI instead of trying to fix this issue.... :)
@snaix93 So glad! It is a little tricky... and time consuming.
One other thing, to use Linux GUIs, like the Cypress GUI, you'll need a Windows X Server. I am using VcXsrv: https://sourceforge.net/projects/vcxsrv/
cypress:cli:cli cli starts with arguments ["/home/ke/.nvm/versions/node/v13.14.0/bin/node","/a/code/ComicEater/node_modules/.bin/cypress","verify"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli:cli program parsing arguments +1ms
cypress:cli parsed cli options {} +1ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +1ms
cypress:cli checking if executable exists /home/ke/.cache/Cypress/4.5.0/Cypress/Cypress +2ms
cypress:cli Binary is executable? : true +1ms
cypress:cli binaryDir is /home/ke/.cache/Cypress/4.5.0/Cypress +1ms
cypress:cli Reading binary package.json from: /home/ke/.cache/Cypress/4.5.0/Cypress/resources/app/package.json +0ms
cypress:cli Found binary version 4.5.0 installed in: /home/ke/.cache/Cypress/4.5.0/Cypress +2ms
cypress:cli could not read binary_state.json file at "/home/ke/.cache/Cypress/4.5.0/binary_state.json" +3ms
cypress:cli {} +0ms
cypress:cli is Verified ? undefined +1ms
cypress:cli force verify +0ms
cypress:cli running binary verification check 4.5.0 +0ms
cypress:cli clearing out the verified version +3ms
cypress:cli DISPLAY environment variable is set to localhost:0 on Linux
cypress:cli Assuming this DISPLAY points at working X11 server,
cypress:cli Cypress will not spawn own Xvfb
cypress:cli
cypress:cli NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
cypress:cli see https://github.com/cypress-io/cypress/issues/4034
cypress:cli Solution: Unset the DISPLAY variable and try again:
cypress:cli DISPLAY= npx cypress run ... +0ms
cypress:cli needs Xvfb? false +8ms
cypress:cli spawning, should retry on display problem? true +0ms
cypress:cli disabling Electron sandbox +0ms
cypress:cli running smoke test +0ms
cypress:cli using Cypress executable /home/ke/.cache/Cypress/4.5.0/Cypress/Cypress +0ms
cypress:cli smoke test command: /home/ke/.cache/Cypress/4.5.0/Cypress/Cypress --no-sandbox --smoke-test --ping=886 +0ms
cypress:cli smoke test timeout 30000 ms +0ms
⠸ Verifying Cypress can run /home/ke/.cache/Cypre
ss/4.5.0/Cypress
I can use other electron apps just fine on WSL1 and X410. WSL2 isn't officially released yet so I'm not ready to move to it yet, and won't be deprecated anytime soon. Can this be reopened?
Most helpful comment
I ran into this same problem of Cypress hanging on the verify step.
The call to
util.exec
is where I observed it hanging:https://github.com/cypress-io/cypress/blob/2333d04a54acfd2d89d9d53cc60a49d46228ceef/cli/lib/tasks/verify.js#L68-L71
If I change that first line to:
So that the child process dumps its stdout and stderr to those of the parent process, it still hangs but I get an informative error message:
Which I was able to use to trace back to the problem (same as @derkoe 's -- electron's default appData path was a read-only directory).
Y'all open to a PR to add this? Doesn't address the underlying issue of why
cypress --smoke-test
seems to be not exiting when this kind of failure happens, but it at least adds visibility so folks can self-serve and fix their specific problem more easily.EDIT would need to adjust things a little so the
then
andcatch
callbacks don't blow up with the difference when the smoke test does exit -- more like "y'all open to something along these lines"