Issue #9210 resolved

error: RPC failed; result=52, HTTP code = 0

Massimo Vannucci
created an issue

Trying to do a

GIT_CURL_VERBOSE=1 git push origin master

from an Ubuntu Server 13.10, I get the following error

root@tracker:/usr/local/bin/gammu# GIT_CURL_VERBOSE=1 git push origin master
* Couldn't find host bitbucket.org in the .netrc file; using defaults
* Adding handle: conn: 0x152a070
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x152a070) send_pipe: 1, recv_pipe: 0
* About to connect() to bitbucket.org port 443 (#0)
*   Trying 131.103.20.167...
* Connected to bitbucket.org (131.103.20.167) port 443 (#0)
* found 157 certificates in /etc/ssl/certs/ca-certificates.crt
*    server certificate verification OK
*    common name: bitbucket.org (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: 
*    start date: Wed, 05 Mar 2014 00:00:00 GMT

*    expire date: Wed, 25 May 2016 12:00:00 GMT

*    issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance EV CA-1
*    compression: NULL
*    cipher: AES-128-CBC
*    MAC: SHA256
> GET /blasterspike/gammu.git/info/refs?service=git-receive-pack HTTP/1.1
User-Agent: git/1.8.3.2
Host: bitbucket.org
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

< HTTP/1.1 401 Unauthorized
* Server nginx/1.5.10 is not blacklisted
< Server: nginx/1.5.10
< Date: Thu, 27 Mar 2014 07:10:43 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< WWW-Authenticate: Basic realm="Bitbucket.org HTTP"
< 
* Ignoring the response-body
* Connection #0 to host bitbucket.org left intact
* Issue another request to this URL: 'https://blasterspike@bitbucket.org/blasterspike/gammu.git/info/refs?service=git-receive-pack'
* Couldn't find host bitbucket.org in the .netrc file; using defaults
* Found bundle for host bitbucket.org: 0x14f2d20
* About to connect() to bitbucket.org port 443 (#1)
*   Trying 131.103.20.167...
* Adding handle: conn: 0x17d8610
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x152a070) send_pipe: 0, recv_pipe: 0
* - Conn 1 (0x17d8610) send_pipe: 1, recv_pipe: 0
* Connected to bitbucket.org (131.103.20.167) port 443 (#1)
* found 157 certificates in /etc/ssl/certs/ca-certificates.crt
* SSL re-using session ID
*    server certificate verification OK
*    common name: bitbucket.org (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: 
*    start date: Wed, 05 Mar 2014 00:00:00 GMT

*    expire date: Wed, 25 May 2016 12:00:00 GMT

*    issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance EV CA-1
*    compression: NULL
*    cipher: AES-128-CBC
*    MAC: SHA256
* Server auth using Basic with user 'blasterspike'
> GET /blasterspike/gammu.git/info/refs?service=git-receive-pack HTTP/1.1
Authorization: Basic *******************
User-Agent: git/1.8.3.2
Host: bitbucket.org
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

< HTTP/1.1 401 Unauthorized
* Server nginx/1.5.10 is not blacklisted
< Server: nginx/1.5.10
< Date: Thu, 27 Mar 2014 07:10:46 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="Bitbucket.org HTTP"
< 
* Connection #1 to host bitbucket.org left intact
Password for 'https://blasterspike@bitbucket.org': 
* Couldn't find host bitbucket.org in the .netrc file; using defaults
* Found bundle for host bitbucket.org: 0x14f2d20
* Connection 0 seems to be dead!
* Closing connection 0
* Connection 1 seems to be dead!
* Closing connection 1
* Adding handle: conn: 0x17ca980
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 2 (0x17ca980) send_pipe: 1, recv_pipe: 0
* About to connect() to bitbucket.org port 443 (#2)
*   Trying 131.103.20.168...
* Connected to bitbucket.org (131.103.20.168) port 443 (#2)
* found 157 certificates in /etc/ssl/certs/ca-certificates.crt
* SSL re-using session ID
*    server certificate verification OK
*    common name: bitbucket.org (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: 
*    start date: Wed, 05 Mar 2014 00:00:00 GMT

*    expire date: Wed, 25 May 2016 12:00:00 GMT

*    issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance EV CA-1
*    compression: NULL
*    cipher: AES-128-CBC
*    MAC: SHA256
* Server auth using Basic with user 'blasterspike'
> GET /blasterspike/gammu.git/info/refs?service=git-receive-pack HTTP/1.1
Authorization: Basic *******************
User-Agent: git/1.8.3.2
Host: bitbucket.org
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache

< HTTP/1.1 200 OK
* Server nginx/1.5.10 is not blacklisted
< Server: nginx/1.5.10
< Date: Thu, 27 Mar 2014 07:12:19 GMT
< Content-Type: application/x-git-receive-pack-advertisement
< Transfer-Encoding: chunked
< Connection: keep-alive
< 
* Connection #2 to host bitbucket.org left intact
Counting objects: 13, done.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 7.54 KiB | 0 bytes/s, done.
Total 12 (delta 4), reused 0 (delta 0)
* Couldn't find host bitbucket.org in the .netrc file; using defaults
* Adding handle: conn: 0x1ab6170
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 3 (0x1ab6170) send_pipe: 1, recv_pipe: 0
* About to connect() to bitbucket.org port 443 (#3)
*   Trying 131.103.20.167...
* Connected to bitbucket.org (131.103.20.167) port 443 (#3)
* found 157 certificates in /etc/ssl/certs/ca-certificates.crt
* SSL re-using session ID
*    server certificate verification OK
*    common name: bitbucket.org (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: 
*    start date: Wed, 05 Mar 2014 00:00:00 GMT

*    expire date: Wed, 25 May 2016 12:00:00 GMT

*    issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance EV CA-1
*    compression: NULL
*    cipher: AES-128-CBC
*    MAC: SHA256
* Server auth using Basic with user 'blasterspike'
> POST /blasterspike/gammu.git/git-receive-pack HTTP/1.1
Authorization: Basic *******************
User-Agent: git/1.8.3.2
Host: bitbucket.org
Accept-Encoding: gzip
Content-Type: application/x-git-receive-pack-request
Accept: application/x-git-receive-pack-result
Content-Length: 7880

* upload completely sent off: 7880 out of 7880 bytes
* Empty reply from server
* Connection #3 to host bitbucket.org left intact
error: RPC failed; result=52, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
root@tracker:/usr/local/bin/gammu#

After

* upload completely sent off: 7880 out of 7880 bytes

it hangs for a while and then it returns the error. I tried also with

GIT_TRACE=1 git push origin master

but I don't get any useful output.

I have tried also with

git config http.postBuffer 524288000

but I get the same error.

Please let me know if I can debug any more. I would like to used this git repository using https instead of SSH.

Regards

Massimo

Comments (10)

  1. Erik van Zijst staff

    Does SSH work? How much data is in the push?

    You might want to change your password btw, you pasted the Base64 encoded version of it in your output. Actually, what surprises me is that there are 2 different credentials in your headers.

    How many seconds does it (roughly) hang before it fails?

  2. Massimo Vannucci reporter

    Damn, wrong copy/paste. Password changed.

    After

    * upload completely sent off: 7880 out of 7880 bytes
    

    it hangs for 58 seconds circa.

    I'm going to test with SSH even if I wouldn't like to use it. The data in the push should be exactly 7880 bytes, right?

  3. Erik van Zijst staff

    Is there any network traffic during those 58 seconds (does Activity Monitor or Windows' task manager show any traffic)?

    I'm going to test with SSH even if I wouldn't like to use it.

    Sure, but it might help us narrow down the problem.

    The data in the push should be exactly 7880 bytes, right?

    Not necessarily. There can be multiple HTTP requests involved in a push. How many commits are you pushing up and what did you change in those commits? Does the repo contain any large binary files that you are pushing up as part of this?

    Also, do you have access to any other network (e.g. office vs home) and do you see the same slowdowns? Do you get similar problems on pushing to other repositories? I'm asking because I don't see anything weird on our end.

  4. Massimo Vannucci reporter

    I have followed this guide

    https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git

    I have created .ssh/config and put the snippet in .bashrc

    Identity is loaded

    root@tracker:~# ssh-add -l
    4096 ae:*************************:e9 /root/.ssh/id_rsa (RSA)
    

    but I get this

    root@tracker:~# ssh -T -vvvv git@bitbucket.org
    OpenSSH_6.2p2 Ubuntu-6ubuntu0.1, OpenSSL 1.0.1e 11 Feb 2013
    debug1: Reading configuration data /root/.ssh/config
    debug1: /root/.ssh/config line 1: Applying options for bitbucket.org
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to bitbucket.org [131.103.20.167] port 22.
    debug1: Connection established.
    debug1: permanently_set_uid: 0/0
    debug3: Incorrect RSA1 identifier
    debug3: Could not load "/root/.ssh/id_rsa" as a RSA1 public key
    debug1: identity file /root/.ssh/id_rsa type 1
    debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-4096
    debug1: Checking blacklist file /etc/ssh/blacklist.RSA-4096
    debug1: identity file /root/.ssh/id_rsa-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.2p2 Ubuntu-6ubuntu0.1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
    debug1: match: OpenSSH_5.3 pat OpenSSH_5*
    debug2: fd 3 setting O_NONBLOCK
    debug3: load_hostkeys: loading entries for host "bitbucket.org" from file "/root/.ssh/known_hosts"
    debug3: load_hostkeys: loaded 0 keys
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
    debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: first_kex_follows 0 
    debug2: kex_parse_kexinit: reserved 0 
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: first_kex_follows 0 
    debug2: kex_parse_kexinit: reserved 0 
    debug2: mac_setup: found hmac-md5
    debug1: kex: server->client aes128-ctr hmac-md5 none
    debug2: mac_setup: found hmac-md5
    debug1: kex: client->server aes128-ctr hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    Connection closed by 131.103.20.167
    

    and before closing the connection, it hangs for 120 seconds circa.

    Using the same repository from another computer from another network, works very well.

    Is there anything else I can debug on this server?

    Data transmitted are very small, I have changed only some lines in a python script. No binaries in this repository.

  5. Erik van Zijst staff

    Using the same repository from another computer from another network, works very well.

    Then this might be pointing at an issue either with your machine's configuration, or a network issue.

    Since you don't even seem to be able to authenticate over ssh, can you verify that there are no firewall rules that might be messing things up? This is no longer a bandwidth or performance issue, but a more fundamental issue of your machine not being able to maintain a TCP session.

    If you want you could share the tcpdump, but maybe you can first have a look at that yourself. Just load it up in wireshark and check what is going on. Is the connection actively being closed, are you seeing packet loss (and retransmissions)? What about a (TCP) traceroute to our servers? Does that reveal any network bottlenecks?

    Do you get similar problems on pushing to other repositories?

  6. Log in to comment