git pull error: RPC failed; result=52, HTTP code = 0
Asked by Shahrul Azim:

I encounter this error message when try to perform git pull on my linux server

    [user1@test projectfolder]$ git pull -vPassword for 'https://usergit@bitbucket.org': POST git-upload-pack (949 bytes)POST git-upload-pack (999 bytes)error: RPC failed; result=52, HTTP code = 0

so far i have tried

1. increase postBuffer to 1048576000

2. using SSH

in config

\[core\]  
repositoryformatversion = 0  
filemode = true  
bare = false  
logallrefupdates = true  
compression = 0  
packedGitLimit = 1g  
packedGitWindowSize = 1g  
\[pack\]  
packSizeLimit = 1g  
deltaCacheSize = 1g  
windowMemory = 1g  
\[http\]  
pullbuffer = 50k  
postBuffer = 1048576000

But still getting the same error. what else should i try?


Answers:
author: Patrik S
body: Hello [@Shahrul Azim](/t5/user/viewprofilepage/user-id/5385226) and welcome to the Community!

Could you confirm if the same error happens when you do a fresh clone of the repository in a different folder?

For that, you can use the command below that includes verbose logs and then share the output with us :

```
GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone https://{username}:{app_password}@bitbucket.org/{workspace}/{repository}.git
```

Please note that the log output will contain an Authorization section with your encoded app password. Make sure to remove this information, and any other sensitive information, before sharing the logs here, as this is a public forum.

Thank you, [@Shahrul Azim](/t5/user/viewprofilepage/user-id/5385226) !

Patrik S

comments: author: Shahrul Azim
body: hi [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) i keep getting an error when tried to reply


author: Shahrul Azim
body: \[testus@test repos\]$ GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone <https://username@bitbucket.org/misa/myprojectname.git>  
trace: built-in: git 'clone' '<https://username@bitbucket.org/misa/myprojectname.git>'  
Cloning into 'myprojectname'...  
trace: run_command: 'git-remote-https' 'origin' '<https://username@bitbucket.org/misa/myprojectname.git>'  
\* Couldn't find host bitbucket.org in the .netrc file; using defaults  
\* About to connect() to bitbucket.org port 443 (#0)  
\* Trying 104.192.141.1...  
\* Connected to bitbucket.org (104.192.141.1) port 443 (#0)  
\* Initializing NSS with certpath: sql:/etc/pki/nssdb  
\* CAfile: /etc/pki/tls/certs/ca-bundle.crt  
CApath: none  
\* SSL connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256  
\* Server certificate:  
\* subject: CN=bitbucket.org,O="Atlassian US, Inc.",L=San Francisco,ST=California,C=US,serialNumber=3928449,businessCategory=Private Organization,incorporationState=Delaware,incorporationCountry=US  
\* start date: Apr 28 00:00:00 2023 GMT  
\* expire date: Apr 19 23:59:59 2024 GMT  
\* common name: bitbucket.org  
\* issuer: CN=DigiCert SHA2 Extended Validation Server CA,OU=[www.digicert.com,O=DigiCert](http://www.digicert.com,O=DigiCert) Inc,C=US  
\> GET /misa/myprojectname.git/info/refs?service=git-upload-pack HTTP/1.1  
User-Agent: git/1.8.3.1  
Host: bitbucket.org  
Accept: \*/\*  
Accept-Encoding: gzip  
Pragma: no-cache


author: Shahrul Azim
body: \< HTTP/1.1 401 Unauthorized  
\< Www-Authenticate: Basic realm="Bitbucket.org HTTP"  
\< Cache-Control: no-cache  
\< Content-Type: text/plain; charset=utf-8  
\< X-B3-Traceid: f1aa5a45df81ccd0  
\< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload  
\< Date: Mon, 18 Dec 2023 12:56:05 GMT  
\< X-Server: 218acd2665fb  
\< X-Content-Type-Options: nosniff  
\< Connection: close  
\< X-Version: 66f166b26b  
\< Content-Length: 20  
\<  
\* Closing connection 0  
\* Issue another request to this URL: '<https://username@bitbucket.org/misa/myprojectname.git/info/refs?service=git-upload-pack>'  
\* Couldn't find host bitbucket.org in the .netrc file; using defaults  
\* About to connect() to bitbucket.org port 443 (#1)  
\* Trying 104.192.141.1...  
\* Connected to bitbucket.org (104.192.141.1) port 443 (#1)  
\* CAfile: /etc/pki/tls/certs/ca-bundle.crt  
CApath: none  
\* SSL connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256  
\* Server certificate:  
\* subject: CN=bitbucket.org,O="Atlassian US, Inc.",L=San Francisco,ST=California,C=US,serialNumber=3928449,businessCategory=Private Organization,incorporationState=Delaware,incorporationCountry=US  
\* start date: Apr 28 00:00:00 2023 GMT  
\* expire date: Apr 19 23:59:59 2024 GMT  
\* common name: bitbucket.org  
\* issuer: CN=DigiCert SHA2 Extended Validation Server CA,OU=[www.digicert.com,O=DigiCert](http://www.digicert.com,O=DigiCert) Inc,C=US  
\* Server auth using Basic with user 'username'  
\> GET /misa/myprojectname.git/info/refs?service=git-upload-pack HTTP/1.1  
Authorization: Basic xxx==  
User-Agent: git/1.8.3.1  
Host: bitbucket.org  
Accept: \*/\*  
Accept-Encoding: gzip  
Pragma: no-cache


author: Shahrul Azim
body: \< HTTP/1.1 401 Unauthorized  
\* Authentication problem. Ignoring this.  
\< Www-Authenticate: Basic realm="Bitbucket.org HTTP"  
\< Cache-Control: no-cache  
\< Content-Type: text/plain; charset=utf-8  
\< X-B3-Traceid: 2aa12ed10fbc0824  
\< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload  
\< Date: Mon, 18 Dec 2023 12:56:06 GMT  
\< X-Server: 181fb41aee83  
\< X-Content-Type-Options: nosniff  
\< Connection: close  
\< X-Version: 66f166b26b  
\< Content-Length: 20  
\<  
\* Closing connection 1  
Password for '<https://username@bitbucket.org>':  
\* Couldn't find host bitbucket.org in the .netrc file; using defaults  
\* About to connect() to bitbucket.org port 443 (#2)  
\* Trying 104.192.141.1...  
\* Connected to bitbucket.org (104.192.141.1) port 443 (#2)  
\* CAfile: /etc/pki/tls/certs/ca-bundle.crt  
CApath: none  
\* SSL connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256  
\* Server certificate:  
\* subject: CN=bitbucket.org,O="Atlassian US, Inc.",L=San Francisco,ST=California,C=US,serialNumber=3928449,businessCategory=Private Organization,incorporationState=Delaware,incorporationCountry=US  
\* start date: Apr 28 00:00:00 2023 GMT  
\* expire date: Apr 19 23:59:59 2024 GMT  
\* common name: bitbucket.org  
\* issuer: CN=DigiCert SHA2 Extended Validation Server CA,OU=[www.digicert.com,O=DigiCert](http://www.digicert.com,O=DigiCert) Inc,C=US  
\* Server auth using Basic with user 'username'  
\> GET /misa/myprojectname.git/info/refs?service=git-upload-pack HTTP/1.1  
Authorization: Basic xxx==  
User-Agent: git/1.8.3.1  
Host: bitbucket.org  
Accept: \*/\*  
Accept-Encoding: gzip  
Pragma: no-cache

\< HTTP/1.1 200 OK  
\< Cache-Control: no-cache  
\< Content-Type: application/x-git-upload-pack-advertisement  
\< X-B3-Traceid: f3812cba6ca80dae  
\< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload  
\< Date: Mon, 18 Dec 2023 12:56:15 GMT  
\< X-Server: 9a4cca942eb2  
\< Transfer-Encoding: chunked  
\< Connection: close  
\< X-Version: 66f166b26b  
\<


author: Shahrul Azim
body: \* Closing connection 2  
packet: git\< # service=git-upload-pack  
packet: git\< 0000  
packet: git\< fa3a6444524e838710a5ab90ce0299d21ba5f34d HEAD\\0multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed allow-tip-sha1-in-want allow-reachable-sha1-in-want no-done symref=HEAD:refs/heads/master object-format=sha1 agent=git/2.42.0  
packet: git\< 6020c5fe02c8ace29aa1da315a9c71b3c6ed0b9b refs/heads/Change_Device_Id  
packet: git\< 7e91735991618f04389b448acaefc8ec34838f23 refs/heads/Connect-to-XOXtulipAPI  
packet: git\< 5878dc5cd363b6ce1e43c55621567504013478cf refs/heads/webapi_v2  
packet: git\< 0000  
packet: git\> HEAD  
packet: git\> refs/heads/Change_Device_Id  
packet: git\> refs/heads/Connect-to-XOXtulipAPI  
packet: git\> refs/heads/webapi_v2  
packet: git\> 0000  
trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '<https://username@bitbucket.org/misa/myprojectname.git/>'  
trace: exec: 'git' 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '<https://username@bitbucket.org/misa/myprojectname.git/>'  
trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '<https://username@bitbucket.org/misa/myprojectname.git/>'  
packet: fetch-pack\< HEAD  
packet: fetch-pack\< refs/heads/Change_Device_Id  
packet: fetch-pack\< refs/heads/Connect-to-XOXtulipAPI  
packet: fetch-pack\< refs/heads/webapi_v2  
packet: fetch-pack\< 0000  
packet: fetch-pack\< fa3a6444524e838710a5ab90ce0299d21ba5f34d HEAD\\0multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed allow-tip-sha1-in-want allow-reachable-sha1-in-want no-done symref=HEAD:refs/heads/master object-format=sha1 agent=git/2.42.0  
packet: fetch-pack\< 6020c5fe02c8ace29aa1da315a9c71b3c6ed0b9b refs/heads/Change_Device_Id  
packet: fetch-pack\< 7e91735991618f04389b448acaefc8ec34838f23 refs/heads/Connect-to-XOXtulipAPI  
packet: fetch-pack\< 5878dc5cd363b6ce1e43c55621567504013478cf refs/heads/webapi_v2  
packet: fetch-pack\< 0000  
packet: fetch-pack\> want fa3a6444524e838710a5ab90ce0299d21ba5f34d multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/1.8.3.1  
packet: fetch-pack\> want 6020c5fe02c8ace29aa1da315a9c71b3c6ed0b9b


author: Patrik S
body: Hello [@Shahrul Azim](/t5/user/viewprofilepage/user-id/5385226) ,

Thank you for sharing the results. This seems to be an HTTP-related issue. I found this thread in stackoverflow from a user who was able to fix the issue by changing the compression of git :

* <https://stackoverflow.com/a/40917965>

You may want to try those settings to see if it works for you.

Also, have you tried to clone over SSH? Does the same error happen? The following SSH clone command will bring verbose logs :

```
GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git clone git@bitbucket.org:<workspace>/<repository>.git
```

Thank you, [@Shahrul Azim](/t5/user/viewprofilepage/user-id/5385226) !

Patrik S


Tags: bitbucket-cloud

cloud