I am running Ubuntu 12.04 and git

A couple days ago, git was working fine. It would appear the installation or configuration of the passenger module for apache2 has modified some necessary package or altered a file used by one of them, and now any attempt to git clone I have tried results in:

error: gnutls_handshake() failed: A TLS packet with unexpected length was received. while accessing https://github.com/fnando/i18n-js.git/info/refs
fatal: HTTP request failed

All references I can find to this error when attempting a git clone are dated and appear to have to do with at one time, a bug in the default install of git. I have attempted the steps in https://bugs.launchpad.net/ubuntu/+source/pycurl/+bug/926548 but this is not working; the dpkg-source command fails because pycurl_7.19.0-ubuntu3.dsc does not exist.

I have tried removing and reinstalling a number of packages, including git, curl, libcurl3-gnutls, and libcurl4-openssl-dev with no change - git clone still fails with this same error.

At this point, I mostly care about restoring the use of git clone (and whatever other functions will ultimately fail because of the underlying issue).

  • Does this happen with other git services (like bitbucket or gitorious) or is it specific to github? – muru Jul 31 '14 at 17:09
  • I've tried github; the original activity that caused this error was attempting to install some ruby gems for openproject. Worked up until some point yesterday, then started failing with that error. – user311033 Jul 31 '14 at 18:05
  • I picked a random gitorious repository, and cloning over https was successful. So, now I'm a bit more confused as to why the other attempts fail, when they are over the same protocol - unless there are some additional steps occurring mid-clone I cannot observe that make the difference. Based on the openproject forums, no one else is having trouble with the 'bundle install' of their gems, which is using git over https. – user311033 Jul 31 '14 at 18:21
  • 1
    I'd guess something is messing specifically with your connection to Github. According to git.661346.n2.nabble.com/…, you can try the clone with GIT_CURL_VERBOSE=1 to get more detail. – muru Jul 31 '14 at 20:04
  • 1
    That option you can export before running the bundle command, I suppose. export GIT_CURL_VERBOSE=1; bundle install – muru Jul 31 '14 at 20:24

I had the same problem and had to recompile git against libcurl-openssl-v4 instead of gnutls. It might have something to do with the route to the git server and gnutls not liking something about it.

There's a PREVIOUS step by step solution on how to do just this posted on this site but I do have a couple of things I did differently and some issues I ran into.

Firstly I don't suggest using dpkg -i as the method to install the package, use gdebi from the gdebi-core package because it allows you to install a package and its dependencies.

Most importantly one thing that is not mentioned in that solution is that MULTIPLE *.deb packages will be produced, hence the reason to use gdebi-core.

Secondly and lastly make sure to install the git-man package first and THEN install the main package and its dependencies, for some reason the main package listed on that solution won't install with either dpkg or gdebi without installing the manual first.

  • Your last answer was deleted most likely because it did not actually answer the question, only linked to a potential answer with some commentary. – Seth Jul 23 '15 at 4:10
  • Thank you Seth. It pointed to another answer but it also indicated what did NOT work about that answer and included information that I discovered on how to actually make it work. Shouldn't that be consider as a contribution? – eco Jul 23 '15 at 19:22
  • Unfortunately it's not a perfect world, things don't always line up perfectly and different people think slightly differently. Your post didn't really meet our guidelines for an answer, despite the other contribution. If you'd like to edit the actual answer into the post besides the contribution I can undelete it. I know it is probably a bit confusing, but we aren't actually a forum, but a Q/A site so what goes on a forum usually doesn't go here. Take a look through the tour and help center if you'd like more info on that. – Seth Jul 24 '15 at 16:26
  • At least now I can comment and actually communicate. I'll do that right now, thank You! – eco Jul 25 '15 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.