Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circle-ci binary installation process fails #2344

Closed
mechanical-turk opened this issue Aug 14, 2018 · 14 comments
Closed

Circle-ci binary installation process fails #2344

mechanical-turk opened this issue Aug 14, 2018 · 14 comments
Assignees
Labels
type: duplicate This issue or pull request already exists

Comments

@mechanical-turk
Copy link

Current behavior:

The binaries fail to install the correct version on circle-ci as part of the post-install script.

Here's some background:

  • We use yarn workspaces to maintain our monorepo
  • A while ago, we had realized that running yarn install just simply failed to install the binaries during post-install. For that reason, we opted in for a hacky solution where we ran npm install cypress 3.0.3 after yarn install was completed. 3.0.3 is the cypress version in our package json.
  • That solution seemed to work well for a while, but every now and then, it fails and we find ourselves dealing with this recurring binary issue.
  • For some reason, cypress thinks that we need to use binary version 3.0.1, even though both the package.json, and the npm install versions are 3.0.3.

Not sure if this is helpful, but here's the error log from cypress:

> cypress@3.0.3 postinstall /home/circleci/repo/services/web-client/node_modules/cypress
> node index.js --exec install

Installing Cypress (version: 3.0.3)

[18:09:56]  Downloading Cypress     [started]
[18:09:58]  Downloading Cypress     [completed]
[18:09:58]  Unzipping Cypress       [started]
[18:11:07]  Unzipping Cypress       [completed]
[18:11:07]  Finishing Installation  [started]
[18:11:07]  Finishing Installation  [completed]

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

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

npm notice created a lockfile as package-lock.json. You should commit this file.
+ cypress@3.0.3
added 197 packages, removed 23 packages and updated 1 package in 88.063s
yarn install v1.7.0
[1/4] Resolving packages...
(node:1763) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "workspace-aggregator-be9cc594-b6d7-4a9e-9fcd-eb84d8b56218 > @matterapp/matter-errors > eslint-config-airbnb@16.1.0" has unmet peer dependency "eslint-plugin-jsx-a11y@^6.0.2".
warning "workspace-aggregator-be9cc594-b6d7-4a9e-9fcd-eb84d8b56218 > graphql-server > graphql-tools@2.8.0" has incorrect peer dependency "graphql@^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0".
warning "workspace-aggregator-be9cc594-b6d7-4a9e-9fcd-eb84d8b56218 > graphql-server > merge-graphql-schemas@1.3.0" has incorrect peer dependency "graphql@^0.10.3".
warning "workspace-aggregator-be9cc594-b6d7-4a9e-9fcd-eb84d8b56218 > graphql-server > babel-jest@21.2.0" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0".
warning "workspace-aggregator-be9cc594-b6d7-4a9e-9fcd-eb84d8b56218 > lambdas > sqsumer@1.1.0" has unmet peer dependency "bluebird@>=3.4.4".
[4/4] Building fresh packages...
warning Ignored scripts due to flag.
success Saved lockfile.
Done in 38.07s.
yarn run v1.7.0
$ ./e2e.sh
$ NODE_ENV=test yarn watch
$ node ./src/scripts/wait-for-servers.js
$ ./node_modules/.bin/react-scripts start
$ DEBUG=gql:* ./node_modules/.bin/nodemon -e js,pug --exec yarn start:dev
[nodemon] 1.12.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `yarn start:dev`
$ ./node_modules/.bin/babel-node ./src/index.js
Starting the development server...

Successfully connected to the servers
$ ./node_modules/.bin/cypress run --record --key 2c0f6e31-f162-49be-86c6-23ef3623524e
The cypress npm package is installed, but the Cypress binary is missing.

We expected the binary to be installed here: /home/circleci/.cache/Cypress/3.1.0/Cypress/Cypress

Reasons it may be missing:

- You're caching 'node_modules' but are not caching this path: /home/circleci/.cache/Cypress
- You ran 'npm install' at an earlier build step but did not persist: /home/circleci/.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 (Debian - 8.10)
Cypress Version: 3.1.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exited with code 1

There are 2 useful tips in here:

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

We currently have caching disabled, so I'm not sure how to proceed here.

Desired behavior:

The desired behavior is for cypress to understand that we want to use v3.0.3, and not v3.0.1.

Steps to reproduce:

  • Create a monorepo with yarn workspaces
  • Use circle-ci for ci
  • Install and run cypress on the ci container

Versions

  • Cypress: 3.0.3
  • Circle-ci 2.0
  • yarn 1.7.0
@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Aug 14, 2018
@paulfalgout
Copy link
Contributor

I think #2340 is the same issue

@mechanical-turk
Copy link
Author

@paulfalgout just out of curiosity, do you also see installation issues whenever Cypress releases a new version?

@paulfalgout
Copy link
Contributor

We'll I've only had this problem the once, but I've only updated from a v3.x to another v3.x once as well, which I think is part of the issue. Do you have cypress installed in multiple workspaces? I had attributed my issue to that.

@mechanical-turk
Copy link
Author

We actually only depend on cypress in one package, so that would at least mean that our issue is not attributable to multiple versions

@mechanical-turk
Copy link
Author

hi cypress team! would it be possible to get some updates here? have you guys experimented with installing cypres binaries from within yarn workspaces?

@kuceb
Copy link
Contributor

kuceb commented Sep 17, 2018

It's likely this is a bug in the cli, I will look into this, thanks for all the detailed info

@jennifer-shehane jennifer-shehane added this to the Sprint 3 milestone Sep 17, 2018
@bhellman1
Copy link

Hey @bkucera @jennifer-shehane any luck w this issue?

@jennifer-shehane jennifer-shehane modified the milestones: Sprint 3, Sprint 5 Oct 1, 2018
@jennifer-shehane jennifer-shehane modified the milestones: Sprint 5, Sprint 7 Oct 15, 2018
@kuceb
Copy link
Contributor

kuceb commented Oct 17, 2018

@mechanical-turk where do you see Cypress 3.0.1 mentioned? I see version 3.1.0 in the log you posted

Platform: linux (Debian - 8.10)
Cypress Version: 3.1.0
error Command failed with exit code 1.

Is it possible your package.json has a different version of cypress installed? You shouldn't have to run npm install cypress seperately from npm/yarn install. You'll also need to make sure you rimraff node_modules before a yarn install

@kuceb
Copy link
Contributor

kuceb commented Oct 17, 2018

Also, globally installing cypress isn't recommended, because it can cause errors like this with mismatched versions

@jennifer-shehane jennifer-shehane removed this from the Sprint 7 milestone Oct 26, 2018
@jennifer-shehane
Copy link
Member

This also happens when having multiple cypress deps of the same version See #4595

@mechanical-turk Any update on your side?

@mechanical-turk
Copy link
Author

@jennifer-shehane we could not find a solution so we ended up temporarily disabling cypress on our CI layer. It's kinda funny but nowadays we run our tests locally and not on CI anymore. I'm sure that if you folks keep up your good work, it'll be resolved in no time!

@harshi1991
Copy link

We'll I've only had this problem the once, but I've only updated from a v3.x to another v3.x once as well, which I think is part of the issue. Do you have cypress installed in multiple workspaces? I had attributed my issue to that.

@paulfalgout can you please explain how did you solve that? I am switching from one version to another and getting the same issue.

@jennifer-shehane
Copy link
Member

Closing as duplicate of #4595 as I don't see any evidence that this is happening outside of yarn workspaces.

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

@jennifer-shehane jennifer-shehane added type: duplicate This issue or pull request already exists and removed stage: needs investigating Someone from Cypress needs to look at this labels May 6, 2020
@ojones
Copy link

ojones commented May 11, 2020

Our issue came from switching from npm to yarn in circleci. We got this error:
The cypress npm package is installed, but the Cypress binary is missing. We expected the binary to be installed here: /home/circleci/.cache/Cypress/3.5.0/Cypress/Cypress

The solution was to persist the cypress/* folder:

- persist_to_workspace:
    root: .
    paths:
      - node_modules/*
      - cypress/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

7 participants