7

I've read around on StackOverflow, and found similar situations to mine, but none close enough for me to figure out what I should try to do next. I'm trying to pull fresh copies of libraries required to build a project I'm working on (git clone).

I'm issuing the following command (enabling GIT_CURL_VERBOSE for more info) and getting the following data:

[thexfactor@THISISMYSERVER ~]$ GIT_CURL_VERBOSE=1 git clone http://github.com/symfony/symfony.git

Cloning into 'symfony'...
* Couldn't find host github.com in the .netrc file, using defaults
* About to connect() to github.com port 80
*   Trying 192.30.252.129... * connected
* Connected to github.com (192.30.252.129) port 80
> GET /symfony/symfony.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.2.1
Host: github.com
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

< HTTP/1.1 301 Moved Permanently
< Content-length: 0
< Location: https://github.com/symfony/symfony.git/info/refs?service=git-upload-pack
< Connection: close
* Closing connection #0
* Issue another request to this URL: 'https://github.com/symfony/symfony.git/info/refs?service=git-upload-pack'
* Couldn't find host github.com in the .netrc file, using defaults
* About to connect() to github.com port 443
*   Trying 192.30.252.129... * connected
* Connected to github.com (192.30.252.129) port 443
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using RC4-SHA
* Server certificate:
*    subject: /2.5.4.15=Private Organization/1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/serialNumber=5157550/streetAddress=548 4th Street/postalCode=94107/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com
*    start date: 2013-06-10 00:00:00 GMT
*    expire date: 2015-09-02 12:00:00 GMT
*    subjectAltName: github.com matched
*    issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV CA-1
* SSL certificate verify ok.
> GET /symfony/symfony.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.2.1
Host: github.com
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Wed, 25 Sep 2013 13:37:05 GMT
< Content-Type: application/x-git-upload-pack-advertisement
< Transfer-Encoding: chunked
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
* Connection #0 to host github.com left intact
* Couldn't find host github.com in the .netrc file, using defaults
* About to connect() to github.com port 80
*   Trying 192.30.252.129... * connected
* Connected to github.com (192.30.252.129) port 80
> POST /symfony/symfony.git/git-upload-pack HTTP/1.1
User-Agent: git/1.8.2.1
Host: github.com
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Encoding: gzip
Content-Length: 1474

< HTTP/1.1 301 Moved Permanently
< Content-length: 0
< Location: https://github.com/symfony/symfony.git/git-upload-pack
< Connection: close
* Closing connection #1
* Issue another request to this URL: 'https://github.com/symfony/symfony.git/git-upload-pack'
* Violate RFC 2616/10.3.2 and switch from POST to GET
* Couldn't find host github.com in the .netrc file, using defaults
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (192.30.252.129) port 443
> GET /symfony/symfony.git/git-upload-pack HTTP/1.1
User-Agent: git/1.8.2.1
Host: github.com
Accept: */*
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Encoding: gzip

* The requested URL returned error: 400
* Closing connection #0
error: RPC failed; result=22, HTTP code = 400
fatal: The remote end hung up unexpectedly

Issuing a command for http*s*://github.com/symfony/symfony.git works. That's not the question. Fetching symfony is one library in a large set of libs that are part of a composer file for a library I'm trying to include.

Without the extra info, the response is simply:

error: RPC failed; result=22, HTTP code = 400
fatal: The remote end hung up unexpectedly

All requests for libs over HTTPS work, none over HTTP. I'd prefer to understand why this was working for me yesterday, and why I have to change everything over to HTTPS now - I can't modify the composer file and contribute back, and would prefer a solution to a workaround.

Anyone good at parsing the response headers, to figure out what might be happening?

thexfactor
  • 1,331
  • 1
  • 8
  • 11
  • 8
    What version of git? What version of libcurl? GitHub recently started redirecting http repository access to https and it appears your git is unhappy about this change. – Edward Thomson Sep 25 '13 at 15:15
  • 2
    @EdwardThomson is right. Had this problem just now. Changing the url from `http` to `https` resolved it. – Michal Trojanowski Sep 25 '13 at 19:12
  • 1
    git version 1.8.2.1 - if it's affected more than just me and there's really no way to avoid switching from http:// to https:// then I guess the composer file will need to be changed to include libraries from the httpS version of GitHub sites. Was thinking that a recent server reboot on my end caused a config to change. If not, there's nothing to do until GitHub stops redirecting to http*s*. – thexfactor Sep 25 '13 at 19:30
  • Re: version of libcurl, I'm on CentOS 5.9, and my lib binary is named libcurl.so.3.0.0. Not sure that's accurate enough to answer the question. My version of curl is 7.15.5, and it says it's using libcurl 7.15.5... but ldd /usr/bin/curl says it's linking to libcurl.so.3.0.0 so...? – thexfactor Sep 25 '13 at 21:54
  • @EdwardThomson You should really wrap this comment in an answer ;-) – nulltoken Oct 10 '13 at 17:42
  • Agreed. @EdwardThomson, I'd accept that comment regarding the Github redirect. Seems like it was a global change that happened around the same time I rebooted my server. Coincidences waste so much time :) – thexfactor Oct 22 '13 at 16:42
  • @thexfactor: I'd be happy to, but I would love to bring it to conclusion, too, instead of just point out why it failed; did upgrading your git version fix this? – Edward Thomson Oct 22 '13 at 17:16

2 Answers2

3

switch http, https to ssh, it will be work !

# origin
git clonie http://github.com/gmarik/vundle.git

# new
git clone git@github.com:gmarik/vundle.git
Chu-Siang Lai
  • 2,658
  • 1
  • 24
  • 21
1

I had a similar problem, it was immediately solved when I upgraded to git version 1.8.x

niels
  • 185
  • 1
  • 2
  • 9
  • Yes, I had a similar problem as well, which made me think to upgrade git. But the similar problem had a different result/HTTP code. The HTTP code 400 error seems to have been an issue with GitHub specifically. – thexfactor Oct 22 '13 at 16:41