简体   繁体   中英

How to fix 'ECONNRESET: socket hang up' on Windows Subsystem for Linux?

I'm trying to set up Sidekiq on my Heroku app - currently following this tutorial on GoRails . However, I seem to get errors whenever I run terminal commands that require internet access. I use the Windows Subsystem for Linux in my development and have had no issues with it till now.

For example, when I run heroku config in order to verify my heroku redis has been set up, I get the following (note the error in question in the last line):

 ▸    heroku-cli: update available from 6.14.39-addc925 to
 ▸    6.99.0-ec9edad
 ▸    ECONNRESET: socket hang up

I'm not sure what's wrong, but I don't think it's a heroku-cli issue, per se. I think it's more of a Windows Subsystem for Linux issue. For example, when I run yarn global list , I get the following

yarn global v1.3.2

Done in 0.36s.
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...

Similarly, when I run sudo apt-get update in an effort to update the subsystem itself, I get a whole lot of errors. Here's a small sample:

...
...
Err:14 https://deb.nodesource.com/node_8.x xenial/main Sources
  gnutls_handshake() failed: Error in the push function.
...
...
Err:84 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages
  Connection failed [IP: 91.189.88.161 80]
...
...

It installs some packages, but the connection fails for many of them. Also when running sudo apt-get upgrade heroku :

Err:1 https://cli-assets.heroku.com/branches/stable/apt ./ heroku 6.14.40-1
  gnutls_handshake() failed: Error in the push function.
Err:2 http://security.ubuntu.com/ubuntu xenial-security/main amd64 libssl-doc all 1.0.2g-1ubuntu4.10
  Connection failed [IP: 91.189.88.161 80]
...
...

The update available message that heroku gives me doesn't go away either.

Running heroku update gives me the following:

 ▸    heroku-cli: update available from 6.14.39-addc925 to
 ▸    6.99.0-ec9edad
 ▸    update the CLI with "sudo apt-get upgrade heroku"
 ▸    'ECONNRESET': socket hang up

I don't think it is a network issue, given I can freely access websites on Chrome etc.

Any ideas what could be wrong and what I could do to fix it? (I don't want to try pushing my code till after this is resolved)

After some more digging, it seems the issue was with Kaspersky on Windows. I have closed Kaspersky and started a fresh instance of WSL and everything works just fine, no more gnutls_handshake() failures (or any other failures).

I was first put onto the issue through this server fault question - check the comments on the question.

There appears to be a running thread of this issue (Kaspersky hasn't been overly helpful for a fix :|):

This post claims that the issue is fixed in Windows version 1809 (I have 1803)

And this post also talks about the issues between WSL and Kaspersky.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM