git GnuTLS 接收错误 (-110):TLS 连接未正确终止

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52529639/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:11:47  来源:igfitidea点击:

GnuTLS recv error (-110): The TLS connection was non-properly terminated

gitvimsshvundle

提问by G.yx

I'm preparing to install vim pluginby vundle, after I set the vimrc

我准备通过vundle安装vim插件,在我设置了vimrc之后

set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim

call vundle#begin()

Plugin 'gmarik/Vundle.vim'
Plugin 'valloric/youcompleteme'

call vundle#end()

then I input :PluginInstalland get the error

然后我输入:PluginInstall并得到错误

  2 [2018-09-27 10:47:17] Plugin valloric/youcompleteme                                                | 18 " line enables syntax highlighting by default.
  3 [2018-09-27 10:47:17] $ git clone --recursive 'https://github.com/valloric/youcompleteme.git' '/roo| 19 syntax on;
    t/.vim/bundle/youcompleteme'                                                                       | 20 if has("syntax")
  4 [2018-09-27 10:47:17] > Cloning into '/root/.vim/bundle/youcompleteme'...                          | 21   syntax on
  5 [2018-09-27 10:47:17] > error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was| 22 endif
     non-properly terminated. 

and then I go to the directory ~/.vim/bundleand execute

然后我转到目录~/.vim/bundle并执行

git clone --recursive 'https://github.com/valloric/youcompleteme.git

and get this

得到这个

Cloning into '~/.vim/bundle/youcompleteme'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 34431 (delta 4), reused 8 (delta 1), pack-reused 34416
Receiving objects: 100% (34431/34431), 32.58 MiB | 2.37 MiB/s, done.
error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.
Resolving deltas: 100% (12305/12305), done.

As thissaid, It seems the plugin have been downloaded despite the error. But I can't find the youcompletemedirectory in fact.

由于说,似乎插件已经尽管错误下载。但youcompleteme实际上我找不到目录。

I also try

我也试试

git clone --recursive '[email protected]:Valloric/YouCompleteMe.git' '~/.vim/bundle/youcompleteme'

and get this

得到这个

Cloning into '~/.vim/bundle/youcompleteme'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

So how to solve this?

那么如何解决这个问题呢?

回答by G.yx

Recompile and install git solve it finally, the steps are the following:

最后重新编译安装git解决,步骤如下:

sudo apt-get install build-essential fakeroot dpkg-dev -y
sudo apt-get build-dep git -y
sudo apt-get install libcurl4-openssl-dev -y
cd ~
mkdir source-git
cd source-git/
apt-get source git
cd git-2.*.*/
sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control
sed -i -- '/TEST\s*=\s*test/d' ./debian/rules
dpkg-buildpackage -rfakeroot -b -uc -us
sudo dpkg -i ../git_*ubuntu*.deb

And not use -yis ok, -yjust for skip inputting y. The result is:

不使用-y也可以,-y只是为了跳过输入y。结果是:

Cloning into 'syntastic'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 18671 (delta 9), reused 16 (delta 5), pack-reused 18644
Receiving objects: 100% (18671/18671), 4.26 MiB | 701.00 KiB/s, done.
Resolving deltas: 100% (10572/10572), done.
Checking connectivity... done.

回答by VonC

So how to solve this?

那么如何解决这个问题呢?

By checking if those errors persist during the next few hours.

通过检查这些错误在接下来的几个小时内是否仍然存在。

GitHub statusreports right now

GitHub 状态报告现在

We are investigating reports of elevated error rates.

我们正在调查错误率升高的报告。

And this could be a side-effect of their issues.

这可能是他们问题的副作用。

The other approach is making sure you are using the latest Git release, which the OP did by recompiling Git.

另一种方法是确保您使用的是最新的 Git 版本,OP 通过重新编译 Git 来做到这一点。