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

Cannot install behind a corporate proxy #899

Closed
ThePlenkov opened this issue Oct 29, 2021 · 6 comments · Fixed by #1079
Closed

Cannot install behind a corporate proxy #899

ThePlenkov opened this issue Oct 29, 2021 · 6 comments · Fixed by #1079
Assignees
Labels

Comments

@ThePlenkov
Copy link

Hi! I'm trying to install this module using npm i --save-dev @apollo/rover and I have this:

npm ERR! code 1
npm ERR! path C:\Users\pplenkov\Documents\git_projects\central-deploy-xsa\gitlab\node_modules\@apollo\rover
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./install.js
npm ERR! Downloading release from https://github.com/apollographql/rover/releases/download/v0.3.0/rover-v0.3.0-x86_64-pc-windows-msvc.tar.gz
npm ERR! If you would like to disable Rover's anonymized usage collection, you can set APOLLO_TELEMETRY_DISABLED=1
npm ERR! You can check out our documentation at https://go.apollo.dev/r/docs.
npm ERR! Debugger attached.
npm ERR! Error fetching release: write EPROTO 7528:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:

Debug indicates that it's 100% a proxy issue. We have HTTP_PROXY and HTTPS_PROXY variables maintained.. It looks like issue is inherited from binary-install module. The possible solution may be to maintain a global https agent in install.js.

@ThePlenkov ThePlenkov added bug 🐞 triage issues and PRs that need to be triaged labels Oct 29, 2021
@ThePlenkov
Copy link
Author

what is more interesting - previous apollo and apollo-codegen didn't have this issue.

@EverlastingBugstopper
Copy link
Contributor

Hmmm - this looks like something that will need to be fixed in binary-install - for now you might try installing with the curl | sh installer instead, that one shouldn't have any problems.

@abernix
Copy link
Member

abernix commented Nov 2, 2021

As a work-around, I wonder if something like this works in your environment, through the use of the global-agent npm package?:

# Install global-agent as a dev dep
npm install --save-dev global-agent # https://npm.im/global-agent

# Pass arguments to the Node.js instance of npm to use it the appropriate HTTP_PROXY env
GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE="" npm install --node-options="-r 'global-agent/bootstrap'" --save-dev @apollo/rover 

I haven't tested, but in theory, this might work, assuming node-options are passed through to the invocation of npm within Node.js and affects the agent npm itself uses?

@abernix
Copy link
Member

abernix commented Nov 2, 2021

Hmm, on the other hand, there's also the built-in option https-proxy and it's possible that should be inherited by binary-install if it's already set for npm itself?

@rwilcox
Copy link

rwilcox commented Nov 2, 2021

Here's a question from where I sit behind a proxy / firewall at $SOON_TO_BE_FORMER_DAY_JOB_JUST_WAIT_TWO_WEEKS : we've had scenarios where the proxy blocks access to certain sites, including sites where some process inside npm install was going to retrieve extra supporting libraries. (Like we see here with npm downloading the rover binaries.)

Would an interesting workaround for this issue be to allow the user to provide (potentially through npm config) an alternative download location? So that they could download rover from their own internal Nexus, vs going to the (potentially blocked) internet all the time?

@EverlastingBugstopper
Copy link
Contributor

This should be fixed by #1067

@abernix abernix removed the triage issues and PRs that need to be triaged label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants