Skip to content

Loading…

Always get connection reset (ECONNRESET) error #467

Closed
caarlos0 opened this Issue · 23 comments
@caarlos0

Don't matter what command I try, I always got this same error with bower:

$ bower search angular 
bower error tunneling socket could not be established, cause=read ECONNRESET

I didn't found bower logs (perhaps I looked in the wrong place), so, I don't have any idea about why am I getting this error.

I'm behind a proxy (cntlm), which is exported in my ENV. npm works as expected. Just bower don't.

Info:

$ env | grep -i proxy
socks_proxy=socks://127.0.0.1:8010/
http_proxy=http://127.0.0.1:3128/
https_proxy=https://127.0.0.1:3128/
ftp_proxy=ftp://127.0.0.1:3128/

$ bower -v
0.9.2

$ npm -v
1.2.18

$ node -v
v0.10.5

OS is an Ubuntu Linux.

If I could give any more info, please ask. I'll be glad to help.

Cheers.

@sindresorhus
Bower member

Please cross link if you ask the same question in other places: http://stackoverflow.com/questions/16446123/bower-tunneling-socket-error-econnreset

@caarlos0

Sorry, Just did it. The wiki is maintained by the community. So if there aren't any up to date instructions, we recommend you to explore the solution yourself and hopefully contribute your findings back!

@caarlos0 caarlos0 closed this
@caarlos0 caarlos0 reopened this
@caarlos0

(didn't meant to close it, damn tab)

@satazor
Bower member

@caarlos0 do you have the strict-ssl option disabled in npm?

@caarlos0

I had it enabled, then I disable it, and still not working.

Thanks

@satazor
Bower member

Humm so it works for npm even with strict-ssl enabled, so I think it's not related with certificates per say..

@caarlos0

Perhaps not. It's probably this shitty corporate proxy... thanks anyway.

@satazor
Bower member

@caarlos0 Bower canary was released and it now supports a few things that mght help:

  • strict-ssl
  • ca

Read about those at the bottom of `https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc

You can install it with npm install -g bower-canary. Please uninstall the old bower before.

@satazor satazor closed this
@thebignet

If it's any help, I'm facing the same problem in the same conditions (cntlm to bypass corporate proxy). I used bower-canary as @satazor suggested. Didn't work until I had the following in my .bowerrc

{
    "proxy" : "http://localhost:3131",
    "https-proxy" : "http://localhost:3131",
    "strict-ssl": false
}

Knowing that 3131 is my proxy port. Don't forget to execute git config --global url."https://".insteadOf git:// when behind a corporate proxy which blocks git protocol if needed

@caarlos0

Thanks @thebignet! Finally managed it to work =D

Thanks!

@marcuswhit

This doesn't work for me, have tried the above suggestions.

Have also cross-posted to Stackoverflow, but not sure how active that is for Bower stuff.

When executing most bower commands (search and install as a start), I get the following:

D:\>bower search jquery
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 1.2s
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 2.5s
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 6.8s
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 15.1s
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 20.3s
bower ECONNRESET    Request to https://bower.herokuapp.com/packages/search/jquery failed: tunneling socket could not be established, cause=Parse Error

Relevant points:

  • I can browse to https://bower.herokuapp.com/packages/search/jquery and it returns a full json response.
  • I can use git to clone, both using the git:// protocol and http(s).
  • I can use NPM directly without these issues (once I've set up my .npmrc file with proxy details)
  • I've tried using Fiddler to determine what's being blocked, but it doesn't detect any calls from the Bower command. I can see calls from NPM commands in Fiddler.
  • I've tried the above suggestion from @thebignet, but with no success.

Any ideas? I'm using Windows 7.

@crystalena

@marcuswhit Try adding your username and userpassword to these lines in .bowerrc . It worked for me!

{
    "proxy" : "http://<username>:<userpassword>@<proxyipaddress>:<port>",
    "https-proxy" : "http://<username>:<userpassword>@<proxyipaddress>:<port>",
    "strict-ssl": false
}
@erizhang

As @thebignet suggested, modified .bowerrc file

{
    "proxy" : "http://localhost:3131",
    "https-proxy" : "http://localhost:3131",
    "strict-ssl": false
}

and execute command as @satazor suggested:
npm install -g bower-canary
with sudo, now it works, thanks for your guys.

@gaving

Incase anybody is still having issues (despite the above), try adding:-

"registry": "http://bower.herokuapp.com"

e.g.:-

{
    "directory": "library",
    "registry": "http://bower.herokuapp.com",
    "proxy" : "http://user:pass@host:8080",
    "https-proxy" : "http://user:pass@host:8080",
    "strict-ssl": false
}

Sorted my issues.

@DriesVandermeulen

Thx @gaving adding the registry worked for me!

@kthejoker

Just wanted to post that adding my username and password to the proxy URLs in .bowercc also fixed it for me.

@nanowizard

The proxy, https-proxy and strict-ssl settings in .bowerrc worked fine for our linux machines, but we are seeing the ECONNRESET issues in Windows (specifically Windows 7), no matter what. If "registry": "http://bower.herokuapp.com" is used, I get an Invalid protocol error.

EDIT:
I was able to get it to work in Windows by removing the proxy and https-proxy options, and adding HTTP_PROXY and HTTPS_PROXY environment variables. This was the only way it seemed to work properly.

@sanjeevsuresh

@nanowizard Adding HTTP_PROXY and HTTPS_PROXY env variables worked for me on Windows 7. Thanks!

@ppaul

I don't know what I am missing here, but when I try to scaffold 'yo gulp-angular', .bowerrc always gets overwritten. It asks me in the beginning about the conflict, but then overwrites it no matter what I choose. Please help

@antoniomtz

I solved it by using Git bash cmd on windows and adding:
export http_proxy="yourproxy:port"

@bownie

Adding the registry entry in addition to the proxies led to less failures and eventually working so many thanks @gaving

@Wasmoo

At my company, we the retry every now and then, and I have no idea why. It seems to go away after an hour. I'm not sure if it's our side or theirs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.