Cypress: Could not install cypress behind firewall - cannot read repository cypress-io/request.git

Created on 17 Mar 2020  Â·  29Comments  Â·  Source: cypress-io/cypress

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

cli existing workaround regression v4.2.0

Most helpful comment

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: https://github.com/cypress-io/cypress-documentation/issues/2661

All 29 comments

@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.

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 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

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.

I think this is related to this change in 4.2.0, but I'm not sure why: https://github.com/cypress-io/cypress/pull/6694

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...

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

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"

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

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.

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.

Yeah we should publish it under @cypress/request and only use npm registry

Sent from my iPhone

On Mar 18, 2020, at 15:51, Zach Bloomquist notifications@github.com wrote:


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.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

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.

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 ?

@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.

@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).

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

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.

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 :-)

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: https://github.com/cypress-io/cypress-documentation/issues/2661

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

@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.

I have change the version :-1:
{
"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

and i man not using yarn

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

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 Filesnodejsnode_modulesnpmnode_modulesread-package-jsonread-json.js:469:11)
9 verbose stack at parseJson (C:Program Filesnodejsnode_modulesnpmnode_modulesread-package-jsonread-json.js:105:26)
9 verbose stack at C:Program Filesnodejsnode_modulesnpmnode_modulesread-package-jsonread-json.js:52:5
9 verbose stack at C:Program Filesnodejsnode_modulesnpmnode_modulesgraceful-fsgraceful-fs.js:115:16
9 verbose stack at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
10 verbose cwd C:UsersHappy_PCCypressAutomation
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:UsersHappy_PCCypressAutomationpackage.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 ]

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

thanks very much.
got the solution.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carloscheddar picture carloscheddar  Â·  3Comments

zbigniewkalinowski picture zbigniewkalinowski  Â·  3Comments

brian-mann picture brian-mann  Â·  3Comments

jennifer-shehane picture jennifer-shehane  Â·  3Comments

egucciar picture egucciar  Â·  3Comments