12

I'm trying to clone a git repository and I'm receiving following error while executing the command:

GnuTLS recv error (-9): A TLS packet with unexpected length was received.

My client machine is a Ubuntu 14.04.

sebix
  • 2,943
  • 2
  • 28
  • 43
Amith Jayasekara
  • 421
  • 1
  • 4
  • 11

3 Answers3

2

This is Known bug as @Ivan Ternovtsiy said ,but there is workaround

Remove current GIT from your system

 sudo apt-get purge git

Download GIT deb git_1.9.1-1_amd64.deb link

Execute the downloaded DEB.

ERK
  • 344
  • 6
  • 27
2

If you are in china,may be you should set proxy for git,for example

git config --global https.proxy 'socks5://127.0.0.1:9999'
iamdsy
  • 71
  • 1
  • 2
1

Your mileage may vary, but in my case I was suspecting two factors:

  • low download speed -> connection too long on big repository
  • my Internet provider doesn't like long connections and closes them

So I decided to change Internet provider and pick a higher bandwidth. It's working fine now. I'm not sure if only changing provider or picking a higher bandwidth would have been enough, so you'd have to try out.

Note: I used to use a workaround I mentioned in another question which is about shallow cloning, and that made me think that shorter connections may work.

hsandt
  • 709
  • 7
  • 12