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

7

12

I'm preparing to install vim plugin by vundle, after I set the 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 :PluginInstall and get the error

  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/bundle and execute

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 this said, It seems the plugin have been downloaded despite the error. But I can't find the youcompleteme directory in fact.

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?

Conciliator answered 27/9, 2018 at 4:51 Comment(0)
C
38

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

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 -y is ok, -y just for skip inputting y. The result is:

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.
Conciliator answered 27/9, 2018 at 6:19 Comment(8)
Thanks a lot, works indeed perfectly in Ubuntu 18.04 !Coquet
best answer I've unearthed on SO in years. You my dude, wherever you are, deserve a beer.Catharine
upon running $apt-get source git getting "E: You must put some 'source' URIs in your sources.list" unable to proceed further..Anteversion
Enabled ""Source code" under "Software & Updates" app fixed the above mentioned issue.Anteversion
Above commands made me install few dependencies. Once I install those manually, was able to proceed with build and install git again. ThanksAnteversion
This works well! I'm on a focal-20201106 docker container. Uncommeted lines with # deb-src... in /etc/apt/sources.list and ran apt-get update. After the command apt-get source git three files were in the directory: git_2.25.1-1ubuntu3.dsc , git_2.25.1-1ubuntu3.debian.tar.xz, git_2.25.1.orig.tar.xz. Extracting the .orig. file creates git-2.25.1/. Then extract the -1ubuntu3. file inside git-2.25.1/. And run the rest from there.Meshed
Helped me on Raspbian GNU/Linux 10 (buster) for our company used bitbucket repo. But last line needed to be changed to: sudo dpkg -i ../git_2.20.1-2+deb10u3_armhf.debFlatboat
This doesn't build on Ubuntu 18.04 for me. The dpkg-buildpackage line gives the error: "dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libcurls.so.4 (used by debian/git/usr/lib/git-core/git-http-push)"Riorsson
P
10

Here's a more up-to-date way of doing this. I am using Ubuntu 20.04 on WSL2 on Win10.

sudo apt remove git -y
sudo apt update && sudo apt upgrade

DEBIAN_FRONTEND=noninteractive

sudo apt install build-essential autoconf dh-autoreconf libcurl4-openssl-dev \
                 tcl-dev gettext asciidoc docbook2x install-info \
                 libexpat1-dev libz-dev -y

wget https://raw.githubusercontent.com/paul-nelson-baker/git-openssl-shellscript/master/compile-git-with-openssl.sh .

./compile-git-with-openssl.sh -skiptests
Pulmonic answered 11/5, 2022 at 17:31 Comment(4)
This solved it in the end, thank you! I ran with bash compile-git-with-openssl.sh -skiptestsInterlocutory
This script uses 'make install' w/o package management. You'll have to manually remove all the installed files if you need to do so. Experienced on Ubuntu 22.04Yaron
This works for me on WSL2 Ubuntu 20.04Morissa
This works for me on WSL2 Ubuntu 20.04 behind corporate proxyBloke
G
7

For anyone who may encounter the issue below on windows 10 wsl2 can fix with a following reference:

fakeroot, while creating message channels: Function not implemented
This may be due to a lack of SYSV IPC support. 

https://github.com/microsoft/WSL/issues/2465#issuecomment-377583291

sudo update-alternatives --set fakeroot /usr/bin/fakeroot-tcp
Guck answered 14/8, 2021 at 4:11 Comment(1)
Thanks mate this command works on me sudo update-alternatives --set fakeroot /usr/bin/fakeroot-tcpPrimulaceous
L
3

I found an other way to fix this issue when running CMake from Visual Studio and WSL through Ubuntu 18.04. I found the other way to upgrade GIT to last version here: https://itsfoss.com/install-git-ubuntu/

sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git

Even we still have the GnuTLS recv error (-110) after upgrade, the GIT operation doesn't fail anymore.

Lanfri answered 10/5, 2022 at 6:50 Comment(0)
W
2

I found the solution https://stdworkflow.com/652/error-rpc-failed-curl-56-gnutls-recv-error-110-the-tls-connection-was-non-properly-terminated here, I am just copying the author's answer:

The problem seems to be a problem with Ubuntu gnutls_handshake Solution

recompile git

Use libcurl-openssl-dev to replace gnutls

Install the necessary dependencies and environment

sudo apt-get install build-essential fakeroot dpkg-dev

In case you are using Raspberry pi, you will have the local problem, you might fail to set local, just remember to put export LC_ALL=C in the .bashrc file, and do a reboot.

Create a directory to put the newly compiled git

mkdir ~/git-rectify

Get git source code

cd ~/git-rectify
sudo apt-get source git

Install git dependencies

sudo apt-get build-dep git

Install libcurl

sudo apt-get install libcurl4-openssl-dev

Enter the git directory, where the directory name depends on the version you installed

cd git-2.7.4/

Recompile git after modifying two files

vim ./debian/control # Modify libcurl4-gnutls-dev to libcurl4-openssl-dev
vim ./debian/rules # delete the entire line of TEST=test
sudo dpkg-buildpackage -rfakeroot -b

Go back to the previous directory and install the compiled installation package

cd .. # is in the ~/git-rectify directory
sudo dpkg -i git_2.7.4-0ubuntu0.4_amd64.deb

Source installation git Here is just a record of the steps to install git from the source code.

git clone https://github.com/git/git.git

Switch to the corresponding version tag

git checkout -b v2.22.0
sudo apt-get install libssl-dev

Install it according to the installation command described in the doc document.

Walkon answered 17/6, 2022 at 10:20 Comment(0)
E
1

So how to solve this?

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

GitHub status reports right now

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.

Earnestineearnings answered 27/9, 2018 at 4:54 Comment(1)
thanks for you answer, I solve it by recompiling and installing git.Conciliator
D
0

For some reason 'git pull' was giving this message over and over, 'git pull origin master' worked though

Daffi answered 19/4, 2021 at 15:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.