Cypress fails to run if the directory one level above the binaryDir
of CYPRESS_RUN_BINARY
as shown in the debug logs (see Run binary) is read-only. The error message is similar to:
Error: EACCES: permission denied, open '/home/mike/.cache/Cypress/13.16.0/binary_state.json'
If the Cypress binary was verified before the directory was set to read-only, then the error message is similar to:
Desired behaviorError: EACCES: permission denied, unlink '/home/mike/.cache/Cypress/13.16.0/binary_state.json'
Cypress should be tolerant of a read-only Cypress binary location CYPRESS_RUN_BINARY
directory structure. Verification should take place successfully and Cypress should run.
git clone https://github.com/cypress-io/github-action cd github-action cd examples/basic npm ci VERSION=$(npx cypress version --component binary) echo Cypress binary version is ${VERSION} stat ~/.cache/Cypress/${VERSION} chmod =0555 ~/.cache/Cypress/${VERSION} # make read-only CYPRESS_RUN_BINARY=~/.cache/Cypress/${VERSION}/Cypress/Cypress npx cypress verify # this fails chmod =0775 ~/.cache/Cypress/${VERSION} # restore original permissions CYPRESS_RUN_BINARY=~/.cache/Cypress/${VERSION}/Cypress/Cypress npx cypress verify # this succeeds
Note that pointing CYPRESS_RUN_BINARY
to the binary cache is only done here for convenience of reproduction steps. Normally you would separately download the Cypress binary (https://docs.cypress.io/app/references/advanced-installation#Download-URLs), unzip it, then set the CYPRESS_RUN_BINARY
to point to a location as shown in the documentation (https://docs.cypress.io/app/references/advanced-installation#Run-binary).
First reported on Cypress version: 13.16.0
Continues to be reproducible on Cypress version: 14.2.1
v22.14.0
LTS
Ubuntu 24.04.2
LTS
$ CYPRESS_RUN_BINARY=~/.cache/Cypress/13.16.0/Cypress/Cypress npx cypress verify
cypress:cli:cli cli starts with arguments ["/home/mike/n/bin/node","/home/mike/github/cypress-io/cypress-test-tiny/node_modules/.bin/cypress","verify"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli:cli program parsing arguments +0ms
cypress:cli parsed cli options {} +1ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +1ms
cypress:cli Using CYPRESS_RUN_BINARY from environment variable +81ms
cypress:cli Using CYPRESS_RUN_BINARY from environment variable +0ms
cypress:cli CYPRESS_RUN_BINARY exists, = /home/mike/.cache/Cypress/13.16.0/Cypress/Cypress +0ms
cypress:cli CYPRESS_RUN_BINARY is executable? : true +3ms
cypress:cli CYPRESS_RUN_BINARY has realpath: /home/mike/.cache/Cypress/13.16.0/Cypress/Cypress +0ms
cypress:cli CYPRESS_RUN_BINARY has binaryDir: /home/mike/.cache/Cypress/13.16.0/Cypress +14ms
cypress:cli checking if executable exists /home/mike/.cache/Cypress/13.16.0/Cypress/Cypress +0ms
cypress:cli Binary is executable? : true +0ms
cypress:cli binaryDir is /home/mike/.cache/Cypress/13.16.0/Cypress +1ms
cypress:cli Reading binary package.json from: /home/mike/.cache/Cypress/13.16.0/Cypress/resources/app/package.json +1ms
cypress:cli Found binary version 13.16.0 installed in: /home/mike/.cache/Cypress/13.16.0/Cypress +1ms
cypress:cli could not read binary_state.json file at "/home/mike/.cache/Cypress/13.16.0/binary_state.json" +1ms
cypress:cli {} +0ms
cypress:cli is Verified ? undefined +0ms
cypress:cli force verify +0ms
cypress:cli running binary verification check 13.16.0 +0ms
cypress:cli clearing out the verified version +7ms
cypress:cli DISPLAY environment variable is set to :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 +1ms
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/mike/.cache/Cypress/13.16.0/Cypress/Cypress +1ms
cypress:cli smoke test command: /home/mike/.cache/Cypress/13.16.0/Cypress/Cypress --no-sandbox --smoke-test --ping=423 +0ms
cypress:cli smoke test timeout 30000 ms +0ms
cypress:cli smoke test stdout "It looks like you are running the Cypress binary directly.
This is not the recommended approach, and Cypress may not work correctly.
Please install the cypress NPM package and follow the instructions here:
https://on.cypress.io/installing-cypress
423" +1s
cypress:cli write verified: true +393ms
cypress:cli detecting arch { osPlatform: 'linux', osArch: 'x64' } +2s
cypress:cli arm uname -m result: { stdout: 'x86_64' } +3ms
An unexpected error occurred while verifying the Cypress executable.
Please search Cypress documentation for possible solutions:
https://on.cypress.io
Check if there is a GitHub issue describing this crash:
https://github.com/cypress-io/cypress/issues
Consider opening a new issue.
----------
Error: EACCES: permission denied, open '/home/mike/.cache/Cypress/13.16.0/binary_state.json'
----------
Platform: linux-x64 (Ubuntu - 24.04)
Cypress Version: 13.16.0
Other
Set the environment variable:
See https://docs.cypress.io/app/references/advanced-installation#Environment-variables
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4