Always get connection reset (ECONNRESET) error #467

Closed
caarlos0 opened this Issue May 8, 2013 · 28 comments

Comments

Projects
None yet
@caarlos0

caarlos0 commented May 8, 2013

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

This comment has been minimized.

Show comment
Hide comment
@sindresorhus

sindresorhus May 8, 2013

Member

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

Member

sindresorhus commented May 8, 2013

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

@caarlos0

This comment has been minimized.

Show comment
Hide comment
@caarlos0

caarlos0 May 8, 2013

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 commented May 8, 2013

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 May 8, 2013

@caarlos0 caarlos0 reopened this May 8, 2013

@caarlos0

This comment has been minimized.

Show comment
Hide comment
@caarlos0

caarlos0 May 8, 2013

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

caarlos0 commented May 8, 2013

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

@satazor

This comment has been minimized.

Show comment
Hide comment
@satazor

satazor May 29, 2013

Member

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

Member

satazor commented May 29, 2013

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

@caarlos0

This comment has been minimized.

Show comment
Hide comment
@caarlos0

caarlos0 May 29, 2013

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

Thanks

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

Thanks

@satazor

This comment has been minimized.

Show comment
Hide comment
@satazor

satazor May 29, 2013

Member

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

Member

satazor commented May 29, 2013

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

@caarlos0

This comment has been minimized.

Show comment
Hide comment
@caarlos0

caarlos0 May 29, 2013

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

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

@satazor

This comment has been minimized.

Show comment
Hide comment
@satazor

satazor Jul 10, 2013

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.

Member

satazor commented Jul 10, 2013

@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 Jul 10, 2013

@thebignet

This comment has been minimized.

Show comment
Hide comment
@thebignet

thebignet Jul 24, 2013

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

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

This comment has been minimized.

Show comment
Hide comment
@caarlos0

caarlos0 Jul 24, 2013

Thanks @thebignet! Finally managed it to work =D

Thanks!

Thanks @thebignet! Finally managed it to work =D

Thanks!

@javiervivanco

This comment has been minimized.

Show comment
Hide comment

Thanks @thebignet!!!

@marcuswhit

This comment has been minimized.

Show comment
Hide comment
@marcuswhit

marcuswhit Feb 13, 2014

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.

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

This comment has been minimized.

Show comment
Hide comment
@crystalena

crystalena May 9, 2014

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

@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

This comment has been minimized.

Show comment
Hide comment
@erizhang

erizhang May 27, 2014

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.

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

This comment has been minimized.

Show comment
Hide comment
@gaving

gaving Oct 6, 2014

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.

gaving commented Oct 6, 2014

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

This comment has been minimized.

Show comment
Hide comment
@DriesVandermeulen

DriesVandermeulen Nov 3, 2014

Thx @gaving adding the registry worked for me!

Thx @gaving adding the registry worked for me!

@kthejoker

This comment has been minimized.

Show comment
Hide comment
@kthejoker

kthejoker Nov 13, 2014

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

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

@nanowizard

This comment has been minimized.

Show comment
Hide comment
@nanowizard

nanowizard Dec 9, 2014

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.

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

This comment has been minimized.

Show comment
Hide comment
@sanjeevsuresh

sanjeevsuresh Aug 6, 2015

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

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

@ppaul

This comment has been minimized.

Show comment
Hide comment
@ppaul

ppaul Aug 13, 2015

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

ppaul commented Aug 13, 2015

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

This comment has been minimized.

Show comment
Hide comment
@antoniomtz

antoniomtz Aug 18, 2015

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

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

@bownie

This comment has been minimized.

Show comment
Hide comment
@bownie

bownie Jan 11, 2016

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

bownie commented Jan 11, 2016

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

@Wasmoo

This comment has been minimized.

Show comment
Hide comment
@Wasmoo

Wasmoo Feb 2, 2016

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.

Wasmoo commented Feb 2, 2016

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.

@rana22

This comment has been minimized.

Show comment
Hide comment

rana22 commented Feb 17, 2016

@gaving Thanks

@emrecamasuvi

This comment has been minimized.

Show comment
Hide comment
@emrecamasuvi

emrecamasuvi Mar 2, 2016

thnx @thebignet adding strictssl(false) to related .bowerrc file solved my problem.
proxy and https-proxy definitions also exist in .npmrc .gitconfig and .bowerrc files too.

thnx @thebignet adding strictssl(false) to related .bowerrc file solved my problem.
proxy and https-proxy definitions also exist in .npmrc .gitconfig and .bowerrc files too.

@zqzhang zqzhang referenced this issue in siovene/cordova-plugin-ocf-demo Mar 16, 2016

Closed

bower: command not found #2

@RupenAnjaria

This comment has been minimized.

Show comment
Hide comment
@RupenAnjaria

RupenAnjaria Mar 31, 2016

Where is the .bowerrc file? and what is the exact name of it? (is it just ".bowerrc" or something like "bower.bowerrc"?

Where is the .bowerrc file? and what is the exact name of it? (is it just ".bowerrc" or something like "bower.bowerrc"?

@kthejoker

This comment has been minimized.

Show comment
Hide comment
@kthejoker

kthejoker Mar 31, 2016

File name is just ".bowerrc"

Here's documentation on the file's contents and how bower loads it:

http://bower.io/docs/config/

The no-muss no-fuss method is to just put it in the |path to bower|/config
folder

Here's the priority bower uses to find your config file:

  • CLI arguments via --config
  • Environment variables
  • Local .bowerrc located in the current working directory
  • All .bowerrc files upwards the directory tree
  • .bowerrc file located in user’s home folder (~)
  • .bowerrc file located in the global folder (/)

On Thu, Mar 31, 2016 at 3:58 PM RupenAnjaria notifications@github.com
wrote:

Where is the .bowerrc file? and what is the exact name of it? (is it just
".bowerrc" or something like "bower.bowerrc"?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#467 (comment)

File name is just ".bowerrc"

Here's documentation on the file's contents and how bower loads it:

http://bower.io/docs/config/

The no-muss no-fuss method is to just put it in the |path to bower|/config
folder

Here's the priority bower uses to find your config file:

  • CLI arguments via --config
  • Environment variables
  • Local .bowerrc located in the current working directory
  • All .bowerrc files upwards the directory tree
  • .bowerrc file located in user’s home folder (~)
  • .bowerrc file located in the global folder (/)

On Thu, Mar 31, 2016 at 3:58 PM RupenAnjaria notifications@github.com
wrote:

Where is the .bowerrc file? and what is the exact name of it? (is it just
".bowerrc" or something like "bower.bowerrc"?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#467 (comment)

@ARUNMOHANRAJ471

This comment has been minimized.

Show comment
Hide comment
@ARUNMOHANRAJ471

ARUNMOHANRAJ471 Aug 3, 2017

Thanks @thebignet .. it worked

Thanks @thebignet .. it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment