Do you want to request a feature or report a bug?
Bug
What is the current behavior?
$ yarn add @rails/webpacker
yarn add v1.5.1
info No lockfile found.
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/@rails%2fwebpacker: tunneling socket could not be established, cause=write EPROTO 139879873304384:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:
".
If the current behavior is a bug, please provide the steps to reproduce.
The problem is that I'm behind a corporate proxy. Here are my relevant env settings, with IPs changed to protect the innocent:
http_proxy=http://10.1.2.3:3128
HTTP_PROXY=http://10.1.2.3:3128
ftp_proxy=https://10.1.2.3:3128
FTP_PROXY=https://10.1.2.3:3128
https_proxy=https://10.1.2.3:3128
HTTPS_PROXY=https://10.1.2.3:3128
no_proxy=localhost,localhost.*,10.*,192.168.*,127.0.0.1
NO_PROXY=localhost,localhost.*,10.*,192.168.*,127.0.0.1
I've tried setting --proxy and --https-proxy command line options, I've tried yarn config set, I've tried npm config set, I've tried variations of all three with strict-ssl=false thrown in for good measure (in both yarn and npm, to be sure). Always the same result.
Here's the output of yarn config list:
$ yarn config list
yarn config v1.5.1
info yarn config
{ 'version-tag-prefix': 'v',
'version-git-tag': true,
'version-git-sign': false,
'version-git-message': 'v%s',
'init-version': '1.0.0',
'init-license': 'MIT',
'save-prefix': '^',
'ignore-scripts': false,
'ignore-optional': false,
registry: 'https://registry.yarnpkg.com',
'strict-ssl': false,
'user-agent': 'yarn/1.5.1 npm/? node/v6.13.1 linux x64',
'https-proxy': 'https://10.1.2.3:3128',
proxy: 'http://101.2.3:3128' }
info npm config
{ 'https-proxy': 'https://10.1.2.3:3128',
proxy: 'http://10.1.2.3:3128',
'strict-ssl': false }
Done in 0.04s.
N.B. Just to verify that it's not some DDoS like the answer to #1351 said or any other such thing, I can at the same command line run:
wget https://registry.yarnpkg.com/@rails%2fwebpacker
...and get it pulled down immediately.
What is the expected behavior?
I'm not entirely sure, as this is my first experience with yard. I don't know what a successful yard add looks like, other than no errors. :)
Please mention your node.js, yarn and operating system version.
nodejs: v6.13.1
yarn: 1.5.1
OS: LinuxMint 18.3 (Ubuntu 16.04 base)
Just for completeness, here's the output with --verbose:
$ yarn --verbose add @rails/webpacker
yarn add v1.5.1
verbose 0.407 Checking for configuration file "/home/joel/fusionx/FusionEngage/.npmrc".
verbose 0.411 Checking for configuration file "/home/joel/.npmrc".
verbose 0.412 Found configuration file "/home/joel/.npmrc".
verbose 0.415 Checking for configuration file "/usr/etc/npmrc".
verbose 0.417 Checking for configuration file "/home/joel/fusionx/FusionEngage/.npmrc".
verbose 0.417 Checking for configuration file "/home/joel/fusionx/.npmrc".
verbose 0.417 Checking for configuration file "/home/joel/.npmrc".
verbose 0.418 Found configuration file "/home/joel/.npmrc".
verbose 0.419 Checking for configuration file "/home/.npmrc".
verbose 0.423 Checking for configuration file "/home/joel/fusionx/FusionEngage/.yarnrc".
verbose 0.424 Checking for configuration file "/home/joel/.yarnrc".
verbose 0.425 Found configuration file "/home/joel/.yarnrc".
verbose 0.426 Checking for configuration file "/usr/etc/yarnrc".
verbose 0.427 Checking for configuration file "/home/joel/fusionx/FusionEngage/.yarnrc".
verbose 0.427 Checking for configuration file "/home/joel/fusionx/.yarnrc".
verbose 0.428 Checking for configuration file "/home/joel/.yarnrc".
verbose 0.428 Found configuration file "/home/joel/.yarnrc".
verbose 0.429 Checking for configuration file "/home/.yarnrc".
verbose 0.433 current time: 2018-03-29T14:33:27.176Z
info No lockfile found.
verbose 0.492 Performing "GET" request to "https://yarnpkg.com/latest-version".
[1/4] Resolving packages...
verbose 0.61 Performing "GET" request to "https://registry.yarnpkg.com/@rails%2fwebpacker".
info There appears to be trouble with your network connection. Retrying...
verbose 3.69 Performing "GET" request to "https://yarnpkg.com/latest-version".
verbose 3.695 Performing "GET" request to "https://registry.yarnpkg.com/@rails%2fwebpacker".
info There appears to be trouble with your network connection. Retrying...
verbose 6.841 Performing "GET" request to "https://yarnpkg.com/latest-version".
verbose 6.844 Performing "GET" request to "https://registry.yarnpkg.com/@rails%2fwebpacker".
info There appears to be trouble with your network connection. Retrying...
verbose 9.979 Performing "GET" request to "https://yarnpkg.com/latest-version".
verbose 9.981 Performing "GET" request to "https://registry.yarnpkg.com/@rails%2fwebpacker".
info There appears to be trouble with your network connection. Retrying...
verbose 13.105 Performing "GET" request to "https://yarnpkg.com/latest-version".
verbose 13.115 Performing "GET" request to "https://registry.yarnpkg.com/@rails%2fwebpacker".
verbose 13.238 Error: https://registry.yarnpkg.com/@rails%2fwebpacker: tunneling socket could not be established, cause=write EPROTO 140524769130304:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unk
nown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:
at ClientRequest.onError (/usr/share/yarn/lib/cli.js:146218:17)
at ClientRequest.g (events.js:292:16)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at onwriteError (_stream_writable.js:345:10)
at onwrite (_stream_writable.js:363:5)
at WritableState.onwrite (_stream_writable.js:90:5)
error An unexpected error occurred: "https://registry.yarnpkg.com/@rails%2fwebpacker: tunneling socket could not be established, cause=write EPROTO 140524769130304:error:140770FC:SSL routines:SSL23_GET_S
ERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:
".
I am also behind a corporate proxy and have the same issue during my CI pipeline (GitLab CI hosted inhouse).
This issue does not appear neither on my dev server, nor on my production servers (Ubuntu 16.04).
During my CI pipeline, all jobs run in docker containers based on the same docker image.
Some of the jobs can run yarn install without issues, whereas others fail. wget does work all the time.
Our service provider and I tried to find a solution, but without success. It might be, that the DNS request does not work as it should. I was told that there are requests to URL%20not%20available when a job fails.
Logs:
yarn config v1.7.0
warning package.json: License should be a valid SPDX license expression
info yarn config
{ 'version-tag-prefix': 'v',
'version-git-tag': true,
'version-commit-hooks': true,
'version-git-sign': false,
'version-git-message': 'v%s',
'init-version': '1.0.0',
'init-license': 'MIT',
'save-prefix': '^',
'bin-links': true,
'ignore-scripts': false,
'ignore-optional': false,
registry: 'https://registry.yarnpkg.com',
'strict-ssl': false,
'user-agent': 'yarn/1.7.0 npm/? node/v8.11.2 linux x64' }
info npm config
{}
Done in 0.11s.
yarn install v1.7.0
warning package.json: License should be a valid SPDX license expression
verbose 0.555 Checking for configuration file "/builds/namespace/App/.npmrc".
verbose 0.556 Checking for configuration file "/usr/local/share/.npmrc".
verbose 0.556 Checking for configuration file "/usr/etc/npmrc".
verbose 0.556 Checking for configuration file "/root/.npmrc".
verbose 0.556 Checking for configuration file "/builds/namespace/App/.npmrc".
verbose 0.557 Checking for configuration file "/builds/namespace/.npmrc".
verbose 0.557 Checking for configuration file "/builds/.npmrc".
verbose 0.558 Checking for configuration file "/builds/namespace/App/.yarnrc".
verbose 0.559 Checking for configuration file "/usr/local/share/.yarnrc".
verbose 0.559 Found configuration file "/usr/local/share/.yarnrc".
verbose 0.559 Checking for configuration file "/usr/etc/yarnrc".
verbose 0.559 Checking for configuration file "/root/.yarnrc".
verbose 0.56 Checking for configuration file "/builds/namespace/App/.yarnrc".
verbose 0.56 Checking for configuration file "/builds/namespace/.yarnrc".
verbose 0.56 Checking for configuration file "/builds/.yarnrc".
verbose 0.564 current time: 2018-05-25T07:45:08.023Z
warning [email protected]: License should be a valid SPDX license expression
[1/4] Resolving packages...
[2/4] Fetching packages...
verbose 0.64 Performing "GET" request to "https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.1.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 3.676 Performing "GET" request to "https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.1.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 6.684 Performing "GET" request to "https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.1.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 9.691 Performing "GET" request to "https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.1.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 12.699 Performing "GET" request to "https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.1.tgz".
verbose 12.8 Error: https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.1.tgz: tunneling socket could not be established, cause=write EPROTO 140640082753344:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:
at ClientRequest.onError (/usr/share/yarn/lib/cli.js:147299:17)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at onwriteError (_stream_writable.js:418:12)
at onwrite (_stream_writable.js:440:5)
at _destroy (internal/streams/destroy.js:39:7)
error An unexpected error occurred: "https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.1.tgz: tunneling socket could not be established, cause=write EPROTO 140640082753344:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:
".
info If you think this is a bug, please open a bug report with the information provided in "/builds/namespace/App/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Any solution to this? Getting this same error as well Node v10.6.0 yarn 1.7.0
Was getting the same issue in Node v8.11.3 and Yarn v1.8.0.
What fixed this for me was setting proxy settings for npm:
npm config set proxy http://proxy-host -g
npm config set https-proxy http://proxy-host -g
npm config set no_proxy nexus.hosting.npm-group,localhost -g
sorry it doesn't work for me.
please can someone help me by this error,
I need to install all the dependencies for Kibana with this command in below and I'm not behind a Proxy:
code yarn kbn bootstrap
but I got this error:
Installing dependencies in [@kbn/babel-preset]:
[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80".
Same here. Managed to reproduce by running
export https_proxy=http://myproxy.corp.com:3128
yarn add react # fails
curl https://yarnpkg.com # success
curl https://registry.yarnpkg.com/react # fail
Same with npm, I reckon this seems to be a recent change on the registry backend it self. Not sure if this is related to this issue. For the sake of it I had created also a ticket here: https://npm.community/t/installs-fail-behind-proxy/766
Any Change?? look
curl -v -4 https://registry.yarnpkg.com/
CONNECT registry.yarnpkg.com:443 HTTP/1.1
Host: registry.yarnpkg.com:443
Proxy-Authorization: Basic c2Vydmlkb3JlczoxbmYwcm00dDFjNA==
User-Agent: curl/7.61.0
Proxy-Connection: Keep-Alive< HTTP/1.1 503 Service Unavailable
< Server: squid/3.4.8
< Mime-Version: 1.0
< Date: Sun, 22 Jul 2018 00:25:53 GMT
< Content-Type: text/html
< Content-Length: 1767
< X-Squid-Error: ERR_CONNECT_FAIL 101
<
- Received HTTP code 503 from proxy after CONNECT
- CONNECT phase completed!
- Closing connection 0
curl: (56) Received HTTP code 503 from proxy after CONNECT
Just an update, if this is really based on the proxy/backend issues, then there is a workaround for the proxy as posted in previously linked ticket https://npm.community/t/installs-fail-behind-proxy/766/6 by enabling dns_v4_first (thanks to Andreas Litt) if you're running squid proxy.
Also, it seems that npm ops team has been engaged to this as well. Not sure how connected yarn and npm registries are.
all good, but if I'm not the admin of the system, what do I do? I'm still in trouble it's very unstable, it falls and it works for a while, thanks for everything
I had the same issue, but I changed my https proxies from https_proxy=http://CORP-PROXY:3128, note that I changed the protocol on my host from https to http.
http_proxy=http://CORP-PROXY:3128
HTTP_PROXY=http://CORP-PROXY:3128
https_proxy=http://CORP-PROXY:3128
HTTPS_PROXY=http://CORP-PROXY:3128
https://github.com/Medium/phantomjs/issues/381#issuecomment-344703534
For further reading on Node's insane handling of host environment variables
https://github.com/nodejs/node/issues/8381
I solved similar situation using
$ yarn config set proxy http://username:password@host:port
$ yarn config set https-proxy http://username:password@host:port
I solved similar situation using
$ yarn config set proxy http://username:password@host:port $ yarn config set https-proxy http://username:password@host:port
Thanks, this fixed my issue too.
@johnny1K , do i have to replace the username, password and others with my own value or I just have 2 copy those?
I solved similar situation using
$ yarn config set proxy http://username:password@host:port $ yarn config set https-proxy http://username:password@host:port
Do i have to change those?
You have to change those.
If you want to avoid setting your password like this, you can also only configure username, password will be requested in command line tool.
Most helpful comment
I solved similar situation using