Cypress: Error while downloading Cypress in jenkins by npm

Created on 3 Jan 2019  路  9Comments  路  Source: cypress-io/cypress

Current behavior:

We have a npm dependency of Cypress(3.1.4) in our project

Desired behavior:

Cypress npm dependency should be successfully downloaded.

Steps to reproduce: (app code and test code)

Add cypress3.1.4 as a npm dependency and do a yarn install.

Below logs will give the exact error;

09:51:29 [4/4] Building fresh packages...
09:51:31 error /ibp/data/myproject/node_modules/cypress: Command failed.
09:51:31 Exit code: 1
09:51:31 Command: node index.js --exec install
09:51:31 Arguments: 
09:51:31 Directory: /ibp/data/myproject/node_modules/cypress
09:51:31 Output:
09:51:31 Installing Cypress (version: 3.1.4)
09:51:31 
09:51:31 [?25l[09:51:29]  Downloading Cypress     [started]
09:51:31 [09:51:31]  Downloading Cypress     [completed]
09:51:31 [09:51:31]  Unzipping Cypress       [started]
09:51:31 read err { Error: invalid stored block lengths
09:51:31     at InflateRaw.zlibOnError (zlib.js:153:15) errno: -3, code: 'Z_DATA_ERROR' }
09:51:31 [?25hevents.js:183
09:51:31       throw er; // Unhandled 'error' event
09:51:31       ^
09:51:31 
09:51:31 Error: extra field length exceeds extra field buffer size
09:51:31     at /ibp/data/myproject/node_modules/yauzl/index.js:305:83
09:51:31     at /ibp/data/myproject/node_modules/yauzl/index.js:618:5
09:51:31     at /ibp/data/myproject/node_modules/fd-slicer/index.js:32:7
09:51:31     at FSReqWrap.wrapper [as oncomplete] (fs.js:658:17)

Versions

Cypress version 3.1.4

jenkins

Most helpful comment

I'm having the same issues with circleci consistently (never works)

All 9 comments

I recall some older zlib errors we fixed, but this looks like an error we haven't seen before. https://github.com/cypress-io/cypress/issues/1756

Anything unusual about your Jenkins setup you could add to the issue? Must be some edge case since we haven't seen this.

As you can see the build is very inconsistent and each of the failures are due to the above issue

image

I believe it is a network problem and the zip does not successfully download each time. You should cache the downloaded and installed Cypress binary to avoid re-downloading it each time. See https://on.cypress.io/caching and examples for various CIs in https://github.com/cypress-io/cypress-example-kitchensink#ci-status

@bahmutov actually our CI runs on a clean image everytime and we frequently run into this issue. While there are many other packages that we download but we have not seen these issues.

I faced a similar error with git lab ci. Even after multiple tries, the error stayed. But retrying the next day, the issue was gone. So it does appear to be a temporary issue.

I'm having the same issues with circleci consistently (never works)

we dont see this issue with other packages except for this one, and we consistently see this issue !

Having the same issue with Cypress 3.2.0 in Jenkins

15:25:48.5174 [4/4] Building fresh packages...
15:25:52.5095 error .../node_modules/cypress: Command failed.
15:25:52.5095 Exit code: 1
15:25:52.5096 Command: node index.js --exec install
15:25:52.5096 Arguments:
15:25:52.5096 Directory: .../node_modules/cypress
15:25:52.5096 Output:
15:25:52.5096 Installing Cypress (version: 3.2.0)
15:25:52.5096
15:25:52.5096 [?25l[15:25:50]  Downloading Cypress     [started]
15:25:52.5096 [15:25:50]  Downloading Cypress      0% 0s [title changed]
15:25:52.5096 [15:25:50]  Downloading Cypress      2% 5s [title changed]
15:25:52.5096 [15:25:50]  Downloading Cypress      5% 4s [title changed]
15:25:52.5096 [15:25:50]  Downloading Cypress      10% 3s [title changed]
15:25:52.5096 [15:25:50]  Downloading Cypress      13% 3s [title changed]
15:25:52.5096 [15:25:50]  Downloading Cypress      17% 2s [title changed]
15:25:52.5096 [15:25:50]  Downloading Cypress      22% 2s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      24% 2s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      29% 2s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      32% 2s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      34% 2s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      38% 2s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      43% 2s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      46% 2s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      50% 1s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      65% 1s [title changed]
15:25:52.5096 [15:25:51]  Downloading Cypress      93% 0s [title changed]
15:25:52.5096 [15:25:51]  Downloaded Cypress      [title changed]
15:25:52.5096 [15:25:51]  Downloaded Cypress      [completed]
15:25:52.5097 [15:25:51]  Unzipping Cypress       [started]
15:25:52.5097 [15:25:52]  Unzipping Cypress        0% 0s [title changed]
15:25:52.5097 [?25hevents.js:174
15:25:52.5097       throw er; // Unhandled 'error' event
15:25:52.5097       ^
15:25:52.5097
15:25:52.5097 Error: extra field length exceeds extra field buffer size
15:25:52.5097     at .../node_modules/cypress/node_modules/yauzl/index.js:314:83
15:25:52.5097     at .../node_modules/cypress/node_modules/yauzl/index.js:631:5
15:25:52.5097     at .../node_modules/cypress/node_modules/fd-slicer/index.js:32:7
15:25:52.5097     at FSReqWrap.wrapper [as oncomplete] (fs.js:463:17)

I also had the same issue on CodeShip. In my case, my image didn't have one of the necessary dependencies for cypress (libnotify-dev).
see: https://on.cypress.io/continuous-integration#Dependencies
I performed command sudo apt-get update -qq --yes && sudo apt-get install libnotify-dev -qq and that helped to me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jennifer-shehane picture jennifer-shehane  路  3Comments

zbigniewkalinowski picture zbigniewkalinowski  路  3Comments

tahayk picture tahayk  路  3Comments

carloscheddar picture carloscheddar  路  3Comments

szabyg picture szabyg  路  3Comments