github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Action fails, because "Cannot find cached binary under /home/runner/.cache/CypressCache/8.2.0/Cypress/Cypress"

Open tobiaskraus opened this issue 3 years ago • 6 comments

Error

We haven't changed anything in our workflow settings, but we get suddenly:

We expected the binary to be installed here: /home/runner/.cache/CypressCache/8.2.0/Cypress/Cypress

History

On 1. December our CI Pipeline went through successfully.

On 2. December the Pipeline failed. But we haven't changed anything in our .github/workflows folder. Only some application code changed.

Our e2e.yaml

name: Cypress Tests

on: [push]

env:
  HTTPS: 'true'
  # some more envs....

jobs:
  cypress:
    name: Cypress
    runs-on: ubuntu-latest
    env:
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Cypress run
        uses: cypress-io/github-action@v2
        with:
          build: npm run build
          start: npm start

      - name: Upload videos
        uses: actions/upload-artifact@v2
        if: failure()
        with:
          name: cypress-videos
          path: cypress/videos
Log / Last time successful (Dec. 1.)
Run cypress-io/github-action@v2
  with:
    build: npm run build
    start: npm start
    record: false
    config-file: cypress.json
  env:
    HTTPS: true
   ... 
/usr/local/bin/npm ci

> [email protected] postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/ejs
> node ./postinstall.js


> [email protected] install /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/webpack-dev-server/node_modules/fsevents
> node install.js


Skipping 'fsevents' build as platform linux is not supported

> [email protected] install /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js


Skipping 'fsevents' build as platform linux is not supported

> [email protected] postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/cypress
> node index.js --exec install

Note: Overriding Cypress cache directory to: /home/runner/.cache/Cypress

      Previous installs of Cypress may not be found.

Installing Cypress (version: 8.2.0)

[STARTED] Task without title.
[SUCCESS] Task without title.
[STARTED] Task without title.
[SUCCESS] Task without title.
[STARTED] Task without title.
[SUCCESS] Task without title.

You can now open Cypress by running: node_modules/.bin/cypress open

https://on.cypress.io/installing-cypress

added 2125 packages in 38.899s
/usr/local/bin/npx cypress cache list
┌─────────┬──────────────┐
│ version │ last used    │
├─────────┼──────────────┤
│ 8.2.0   │ 4 months ago │
└─────────┴──────────────┘
/usr/local/bin/npx cypress verify

[STARTED] Task without title.
[SUCCESS] Task without title.
Log / Last first time failed (Dec. 2.)
Run cypress-io/github-action@v2
  with:
    build: npm run build
    start: npm start
    record: false
    config-file: cypress.json
  env:
    HTTPS: true
    ...
/usr/local/bin/npm ci

added 2102 packages, and audited 2103 packages in 42s

... 

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
/usr/local/bin/npx cypress cache list
No cached binary versions were found.
/usr/local/bin/npx cypress verify
The cypress npm package is installed, but the Cypress binary is missing.

We expected the binary to be installed here: /home/runner/.cache/Cypress/8.2.0/Cypress/Cypress

Reasons it may be missing:

- You're caching 'node_modules' but are not caching this path: /home/runner/.cache/Cypress
- You ran 'npm install' at an earlier build step but did not persist: /home/runner/.cache/Cypress

Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.

Alternatively, you can run 'cypress install' to download the binary again.

https://on.cypress.io/not-installed-ci-error

----------

Platform: linux (Ubuntu - 20.04)
Cypress Version: 8.2.0
Error: The process '/usr/local/bin/npx' failed with exit code 1

tobiaskraus avatar Dec 23 '21 13:12 tobiaskraus

Having this very same issue today but with Cypress 8.5.0, seems to be intermittent since after we got this error we ran another CI pipeline and it went through.

ljle avatar Dec 23 '21 20:12 ljle

Same but with Cypress 9.2.0

nitzanashi avatar Dec 24 '21 12:12 nitzanashi

Try to use/restore from Cache as explained/showed here -> https://github.com/cypress-io/github-action/blob/b900bb785402701942376bc3a5e649074b532f88/.github/workflows/example-install-only.yml or https://github.com/cypress-io/github-action/blob/b900bb785402701942376bc3a5e649074b532f88/.github/workflows/example-quiet.yml

DlgSHi avatar Jan 04 '22 09:01 DlgSHi

My team is running into the same issue. The issue looks to be related to a corrupted archive. While we get the same errors noted in this thread, we also get this higher up in the logs:

Run cypress-io/github-action@v2
Received 79691776 of 175842683 (45.3%), 76.0 MBs/sec
Received 60847598 of 60847598 (100.0%), 59.7 MBs/sec
Cache Size: ~58 MB (60847598 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/8ab3c76e-711a-4e7a-ab1b-5aa2e29f217b/cache.tzst -P -C /home/runner/work/ionic-framework/ionic-framework
Cache restored successfully
Received 175842683 of 175842683 (100.0%), 90.6 MBs/sec
Cache Size: ~168 MB (175842683 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/4781644a-2067-47c6-9a38-84d94afa2b35/cache.tzst -P -C /home/runner/work/ionic-framework/ionic-framework
/*stdin*\ : Decoding error (36) : Corrupted block detected 
/usr/bin/tar: Unexpected EOF in archive
/usr/bin/tar: Unexpected EOF in archive
/usr/bin/tar: Error is not recoverable: exiting now
Restoring Cypress cache error: Tar failed with error: The process '/usr/bin/tar' failed with exit code 2

liamdebeasi avatar Jan 11 '22 14:01 liamdebeasi

I had to install cypress from node_modules. This is what my step looks like now:

      - name: Install and Build
        run: |
          yarn install
          yarn build
          ./packages/core/node_modules/cypress/bin/cypress install

We have a monorepo setup, hence /packages/core/.

NorbertNader avatar Jan 14 '22 17:01 NorbertNader

I had to install cypress from node_modules. This is what my step looks like now:

      - name: Install and Build
        run: |
          yarn install
          yarn build
          ./packages/core/node_modules/cypress/bin/cypress install

We have a monorepo setup, hence /packages/core/.

This worked for me 👌🏻 Thanks @NorbertNader!

AndrewOttavianoAbb avatar Jun 22 '22 13:06 AndrewOttavianoAbb

@tobiaskraus

Can we close this issue? It seems like there was some type of disturbance quite a long time ago which has already been resolved.

Our CI tests are all passing.

MikeMcC399 avatar Nov 06 '23 15:11 MikeMcC399

@MikeMcC399 I've given you triage access to the github-action repo so you can use your discretion to close issues.

jennifer-shehane avatar Nov 06 '23 17:11 jennifer-shehane

Hi @jennifer-shehane

Yes, thanks. I've been making use of that privilege. In some cases where it's not obvious if there is still an outstanding issue, then I'm checking with the submitter and I'll give them a grace period to respond before closing. It should be possible to close many of the older issues.

MikeMcC399 avatar Nov 06 '23 18:11 MikeMcC399

Closing, since this is a stale, inactive issue.

MikeMcC399 avatar Nov 09 '23 11:11 MikeMcC399