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

Could not install cypress behind firewall - cannot read repository cypress-io/request.git #6752

Closed
codegeass1 opened this issue Mar 17, 2020 · 29 comments · Fixed by #6777 or m87h/site#83
Labels
cli existing workaround type: regression A bug that didn't appear until a specific Cy version release v4.2.0 🐛 Issue present since 4.2.0

Comments

@codegeass1
Copy link

Current behavior:

This command worked for me until few hours (I saw that there was a new release)

CYPRESS_INSTALL_BINARY=${path}/cypress.zip npm install cypress

I get this error :

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/cypress-io/request.git
npm ERR! Could not read from remote repository

Desired behavior:

Normally it should unzip the zipped cypress and install and I see the package in node_modules. I don't know why it is looking for that github repo.

Versions

3.8.0

@jennifer-shehane
Copy link
Member

@SirineBeji You said 'last few hours', but you mention using 3.8.0 - the latest release is 4.2.0, so which binary are you using? - Because the binary cannot and will not change on Cypress end, it is downloaded on your system and not affected by new releases. You have to download the new release to have changes.

@cypress-bot cypress-bot bot added the stage: awaiting response Potential fix was proposed; awaiting response label Mar 17, 2020
@codegeass1
Copy link
Author

I have tried with 4.2.0 it is the same it is trying to checkout ssh://[email protected]/cypress-io/request.git . Do you know why we are getting this behaviour ?

@PetMou
Copy link

PetMou commented Mar 17, 2020

I also have a problem installing 4.2.0 by CYPRESS_INSTALL_BINARY. returning the same error. We are behind a firewall, so direct download is not permitted.
The installation hangs when trying to remove obsolete packages from the package tree. In my case "[email protected]".
Then I get

C:\Projecten\DWD>npm install [email protected] --save-dev
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://[email protected]/cypress-io/request.git
npm ERR!
npm ERR! ssh: connect to host github.com port 22: Connection timed out
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128

When I remove the package by hand and try it again, it hangs on the next one.
Windows 10 environment, using IntelliJ.
There is nothing wrong with the GIT installation itself, all other GIT actions run fine

@textbook
Copy link

textbook commented Mar 18, 2020

I'm seeing this problem trying to create a multi-stage build of my app in a Docker container, using CYPRESS_INSTALL_BINARY=0 to prevent the binary being downloaded into the container per https://docs.cypress.io/guides/getting-started/installing-cypress.html#Environment-variables.

Relevant section of logs:

Step 8/24 : RUN npm ci
 ---> Running in 4679e167938c
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/cypress-io/request.git
npm ERR! enoent 
npm ERR! enoent 
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-03-17T06_44_36_291Z-debug.log
The command '/bin/sh -c npm ci' returned a non-zero code: 1
The command "docker build ." exited with 1.

Looks like a regression around handling of that env var in 4.2.0; the builds using 4.1.0 are still passing fine.

@jennifer-shehane
Copy link
Member

I think this is related to this change in 4.2.0, but I'm not sure why: #6694

@cypress-bot cypress-bot bot added stage: needs investigating Someone from Cypress needs to look at this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Mar 18, 2020
@jennifer-shehane jennifer-shehane added v4.2.0 🐛 Issue present since 4.2.0 cli labels Mar 18, 2020
@Konstruktour
Copy link

since the update to 4.2.0 i have an additional entry in my (yarn) lockfile

"request@github:cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16":
  version "2.88.1"
  resolved "https://codeload.github.com/cypress-io/request/tar.gz/b5af0d1fa47eec97ba980cde90a13e69a2afcd16"
  dependencies:
    aws-sign2 "~0.7.0"
    aws4 "^1.8.0"
    caseless "~0.12.0"
    combined-stream "~1.0.6"
    extend "~3.0.2"
    forever-agent "~0.6.1"
    form-data "~2.3.2"
    har-validator "~5.1.3"
    http-signature "~1.2.0"
    is-typedarray "~1.0.0"
    isstream "~0.1.2"
    json-stringify-safe "~5.0.1"
    mime-types "~2.1.19"
    oauth-sign "~0.9.0"
    performance-now "^2.1.0"
    qs "~6.5.2"
    safe-buffer "^5.1.2"
    tough-cookie "~2.5.0"
    tunnel-agent "^0.6.0"
    uuid "^3.3.2"

because my build is also behind a firewall, yarn tries to get to that url and fails...

@Pegase745
Copy link

Yeah same as @Konstruktour , not sure it's related to this particular issue, but it's cumbersome for those who use Cypress this way

@almeiduh
Copy link

Hi, we're having the same issue as well. Temporarily solved it by restricting the version as follows in package.json:

"cypress": "~4.1.0"

@mmussmann
Copy link

I think you need to have git installed to use direct git links. We have the same issue, trying to roll back to 4.1

@hanukatreddy
Copy link

I have tried with 4.2.0 it is the same it is trying to checkout ssh://[email protected]/cypress-io/request.git . Do you know why we are getting this behaviour ?

i'm also facing same issue on cypress version 4.1.0 on a linux machine. After I removed cypress package from package.json, our jenkins jobs successfully deployed.

@flotwig
Copy link
Contributor

flotwig commented Mar 18, 2020

That's strange, NPM should fall back to cloning the dependency via https if ssh is not working on your machine. git may be required as well.

To avoid this, Cypress's request fork should be published to NPM, and then we don't need to ship with a GitHub-backed NPM dependency that causes these issues for some users.

@bahmutov
Copy link
Contributor

bahmutov commented Mar 18, 2020 via email

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 19, 2020

The code for this is done in cypress-io/cypress#6777, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Mar 19, 2020
@jennifer-shehane jennifer-shehane added the type: regression A bug that didn't appear until a specific Cy version release label Mar 19, 2020
@codegeass1
Copy link
Author

codegeass1 commented Mar 19, 2020

Even with 3.8.0 it is doing this... I'm on linux and we do the following
CYPRESS_INSTALL_BINARY=${path}/cypress.zip npm install cypress
Git is correctly installed but we are behind a firewall.
Our tests are blocked since three days.
I don't know how this could happen with 3.8.0 and do we need to wait until a release is done ?

@jennifer-shehane
Copy link
Member

@SirineBeji This should not happen in 3.8.0, ensure you are using 3.8.0 release zip. Is it the exact same error above mentioning ssh://[email protected]/cypress-io/request.git

Yes, this will be fixed in our next release estimated for Mar 30.

@textbook
Copy link

@SirineBeji, you're not using 3.8.0 for the install, npm install cypress will get the latest version from your registry. If you want consistency with the local binaries you're trying to reuse, try npm install [email protected] (or use e.g. npm ci to install all packages at the versions specified in the lock file, for reproducible builds).

@jennifer-shehane jennifer-shehane changed the title Could not install cypress with CYPRESS_INSTALL_BINARY Could not install cypress behind firewall - cannot read repository cypress-io/request.git Mar 23, 2020
@bbortt
Copy link

bbortt commented Mar 23, 2020

Any chance to hotfix this? It's kind of annoying for everyone behind proxies.. ;) Or what's the release plan?
Thanks!

@jennifer-shehane
Copy link
Member

Workaround

Install Cypress 4.1.0 - that version does not have this issue. This will be fixed in our next release which is scheduled for Monday.

@Konstruktour
Copy link

This will be fixed in our next release which is scheduled for Monday.

@jennifer-shehane
Whats the idea behind the release schedule? Do u have any general release plan? Or do u release when there are enough features / bugfixes ready? ;)
Btw would be awesome, if you would have any notification system when there is a new release, eg. twitter about it :-)

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Mar 24, 2020

We release every 2 weeks, used to be on Friday - recently changed to Monday. We do releases sooner if something warrants a hotfix (aka something that does not have a workaround that is a blocker for enough users).

Ways to know there is a new release:

  • New entry in GitHub releases
  • New published cypress npm version
  • Our changelog is updated
  • Our bot comments on every issue fixed in the release (can subscribe to specific issues to be notified)
  • There is generally social media announcements about them, but I wouldn't count on these being immediate.

There's likely some utilities out there you could find to notify you on npm release or GitHub release.

Opened an issue in our docs to document this somewhere: cypress-io/cypress-documentation#2661

@errohitrana2013
Copy link

errohitrana2013 commented Mar 27, 2020

As you mention #6861 is duplicate for this issue.
i have check with 4.1.0 also same error.

@jennifer-shehane
Copy link
Member

@errohitrana2013 Please double check that you have a single source of Cypress version (if using yarn, sometimes multiple versions can be defined) - that you're not overriding it with a binary version, that you clean your node_modules.

It is impossible for this bug to appear in version 4.1.0 since the change to the cypress-io/request.git was added in 4.2.0.

@errohitrana2013
Copy link

I have change the version 👎
{
"name": "cypressautomation",
"version": "4.1.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC"
}

and executed this command

npm install cypress --save-dev

still same issue

@errohitrana2013
Copy link

and i man not using yarn

@jennifer-shehane
Copy link
Member

You need to change the cypress version in your devDependencies, not the version of your package.json file.

Run:

npm install [email protected] --save-dev

Screen Shot 2020-03-27 at 4 57 45 PM copy

@errohitrana2013
Copy link

errohitrana2013 commented Mar 27, 2020

Thanks jennifer.

I have changed:- i used app version : 1.0.0 and 1.2.3. Both time same error.
{
"name": "cypressautomation",
"version": "1.0.0",
"scripts": {
"cypress:run": "cypress run --project cypress"
},
"dependencies":{}
"devDependencies":{
"cypress":"4.2.0"
}
}

Error>

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'cypress',
1 verbose cli '--save-dev'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 85452af55fe2de12
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 timing stage:rollbackFailedOptional Completed in 7ms
8 timing stage:runTopLevelLifecycles Completed in 47ms
9 verbose stack Error: Failed to parse json
9 verbose stack Unexpected string in JSON at position 148 while parsing '{
9 verbose stack "name": "cypressautomation",
9 verbose stack "vers'
9 verbose stack at parseError (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:469:11)
9 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:105:26)
9 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:52:5
9 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:115:16
9 verbose stack at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
10 verbose cwd C:\Users\Happy_PC\CypressAutomation
11 verbose Windows_NT 6.3.9600
12 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "cypress" "--save-dev"
13 verbose node v12.13.1
14 verbose npm v6.12.1
15 error code EJSONPARSE
16 error file C:\Users\Happy_PC\CypressAutomation\package.json
17 error JSON.parse Failed to parse json
17 error JSON.parse Unexpected string in JSON at position 148 while parsing '{
17 error JSON.parse "name": "cypressautomation",
17 error JSON.parse "vers'
18 error JSON.parse Failed to parse package.json data.
18 error JSON.parse package.json must be actual JSON, not just JavaScript.
19 verbose exit [ 1, true ]

@textbook
Copy link

@errohitrana2013 that error is unrelated to Cypress generally or this issue specifically; your package.json file is malformed.

@errohitrana2013
Copy link

thanks very much.
got the solution.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 30, 2020

Released in 4.3.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.3.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cli existing workaround type: regression A bug that didn't appear until a specific Cy version release v4.2.0 🐛 Issue present since 4.2.0
Projects
None yet