如何在Windows子系统(适用于Linux)上修复“ ECONNRESET:套接字挂起”?

时间:2019-01-01 12:41:44

标签: ruby-on-rails heroku windows-subsystem-for-linux heroku-cli

我正在尝试在我的Heroku应用中设置Sidekiq-目前正在GoRails上按照本教程进行操作。但是,每当我运行需要访问互联网的终端命令时,我似乎都会出错。在开发过程中,我使用的是Windows Subsystem for Linux,到目前为止还没有任何问题。

例如,当我运行heroku config以验证我的heroku redis已设置时,我得到以下信息(请注意最后一行中的错误):

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

我不确定出什么问题,但是我不认为这本身就是一个heroku-cli问题。我认为这更多是Linux的Windows子系统问题。例如,当我运行yarn global list时,我得到以下信息

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...

类似地,当我运行sudo apt-get update以更新子系统本身时,我遇到了很多错误。这是一个小样本:

...
...
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]
...
...

它安装了一些软件包,但是许多软件包连接失败。同样在运行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]
...
...

heroku给我的update available消息也没有消失。

运行heroku update可为我提供以下信息:

 ▸    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

鉴于我可以在Chrome等设备上自由访问网站,所以我认为这不是网络问题。

有什么想法可能是错误的,我应该怎么做才能解决? (在解决此问题之前,我不想尝试推送我的代码)

1 个答案:

答案 0 :(得分:2)

经过进一步的挖掘,看来问题出在Windows上的卡巴斯基。我关闭了卡巴斯基,并启动了WSL的新实例,一切正常,没有gnutls_handshake()个失败(或其他任何失败)。

我首先是通过this server fault question来解决这个问题的-检查有关该问题的评论。

此问题似乎正在运行(Kaspersky并没有对解决问题提供过多帮助:|):

This post声称该问题已在Windows版本1809(我有1803)中得到解决。

this post还讨论了WSL和卡巴斯基之间的问题。