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

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

When trying to push to a Git repository in Bitbucket Cloud using https, the following errors are encountered

Counting objects: ###, done.
Delta compression using up to # threads.
Compressing objects: 100% (###/###), done.
Writing objects: 100% (###/###), ##.## MiB | ##.## MiB/s, done.
Total ### (delta 64), reused 0 (delta 0)
error: RPC failed; result=18, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

診断

The line that is relevant here is 

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

Specifically, the 'result=18' portion. This is the error code coming from libcurl, the underlying library used in http communications with Git. From the libcurl documentation, a result code of 18 means:

CURLE_PARTIAL_FILE (18)
	A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn't match 
	the previously given size.

原因

This can be caused if your specific Git client is attempting to send more data than your local httpPostbuffer setting is set to allow.

回避策

While we have server site settings set appropriately for this option, you may need to adjust/override your client's settings. To do this, execute the following command(s):
From within a specific repository. Note the number at the end is the size, in bytes that you wish to allow in a single post. If you have much larger files, you may need to increase this number.

 

git config http.postBuffer 524288000

To set this gloablly for all remote Git repositories you ever connect to

git config --global http.postBuffer 524288000

 

To Help the Bitbucket Cloud Support Team Troubleshoot

If the above doesn't resolve your issue, run the following command

GIT_CURL_VERBOSE=1 git push

This will run the push command with the underlying libcurl library set to verbose mode. This will output a lot of data on the command line when running the push. Copy and paste the information output into a support ticket to help the Bitbucket Cloud team troubleshoot what may be wrong in your specific case. 

The following is an example of a request that has completed properly:

ここをクリックして展開...
Marcus-MBP:public_test mbertrand$ GIT_CURL_VERBOSE=1 git push
* Couldn't find host bitbucket.org in the .netrc file; using defaults
* About to connect() to bitbucket.org port 443 (#0)
*   Trying 207.223.240.181...
* Connected to bitbucket.org (207.223.240.181) port 443 (#0)
* Connected to bitbucket.org (207.223.240.181) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt
  CApath: none
* SSL connection using AES256-SHA
* Server certificate:
* 	 subject: businessCategory=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=3928449; street=375 Alabama St Ste 325; postalCode=94110; C=US; ST=CA; L=San Francisco; O=Atlassian, Inc.; CN=bitbucket.org
* 	 start date: 2012-01-03 00:00:00 GMT
* 	 expire date: 2014-03-12 12:00:00 GMT
* 	 subjectAltName: bitbucket.org matched
* 	 issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance EV CA-1
* 	 SSL certificate verify ok.
> GET /username/public_test.git/info/refs?service=git-receive-pack HTTP/1.1
User-Agent: git/1.7.11.2
Host: bitbucket.org
Accept: */*
Pragma: no-cache
< HTTP/1.1 401 Unauthorized
< Server: nginx/1.0.6
< Date: Thu, 13 Sep 2012 19:54:08 GMT
< Transfer-Encoding: chunked
< WWW-Authenticate: Digest realm="Bitbucket.org HTTP", nonce="xxxxxxxx", qop="auth", opaque="xxxxxxxx"
< 
* Ignoring the response-body
* Connection #0 to host bitbucket.org left intact
* Issue another request to this URL: 'https://username@bitbucket.org/username/public_test.git/info/refs?service=git-receive-pack'
* Couldn't find host bitbucket.org in the .netrc file; using defaults
* Re-using existing connection! (#0) with host (nil)
* Connected to (nil) (207.223.240.181) port 443 (#0)
* Server auth using Digest with user 'username'
> GET /username/public_test.git/info/refs?service=git-receive-pack HTTP/1.1
Authorization: Digest username="username", realm="Bitbucket.org HTTP", nonce="xxxxxxx", uri="/username/public_test.git/info/refs?service=git-receive-pack", cnonce="xxxxxxxx", nc=00000001, qop="auth", response="xxxxxxxx", opaque="xxxxxxx"
User-Agent: git/1.7.11.2
Host: bitbucket.org
Accept: */*
Pragma: no-cache
< HTTP/1.1 401 Unauthorized
< Server: nginx/1.0.6
< Date: Thu, 13 Sep 2012 19:54:08 GMT
< Transfer-Encoding: chunked
* Authentication problem. Ignoring this.
< WWW-Authenticate: Digest realm="Bitbucket.org HTTP", nonce="xxxxxxx", qop="auth", opaque="xxxxxxx"
* The requested URL returned error: 401
* Closing connection #0
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 (#0)
*   Trying 207.223.240.181...
* Connected to bitbucket.org (207.223.240.181) port 443 (#0)
* Connected to bitbucket.org (207.223.240.181) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt
  CApath: none
* SSL re-using session ID
* SSL connection using AES256-SHA
* Server certificate:
* 	 subject: businessCategory=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=3928449; street=375 Alabama St Ste 325; postalCode=94110; C=US; ST=CA; L=San Francisco; O=Atlassian, Inc.; CN=bitbucket.org
* 	 start date: 2012-01-03 00:00:00 GMT
* 	 expire date: 2014-03-12 12:00:00 GMT
* 	 subjectAltName: bitbucket.org matched
* 	 issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance EV CA-1
* 	 SSL certificate verify ok.
* Server auth using Digest with user 'username'
> GET /username/public_test.git/info/refs?service=git-receive-pack HTTP/1.1
Authorization: Digest username="username", realm="Bitbucket.org HTTP", nonce="xxxxxxx", uri="/username/public_test.git/info/refs?service=git-receive-pack", cnonce="xxxxxxx", nc=00000001, qop="auth", response="xxxxxx", opaque="xxxxxxx"
User-Agent: git/1.7.11.2
Host: bitbucket.org
Accept: */*
Pragma: no-cache
< HTTP/1.1 200 OK
< Server: nginx/1.0.6
< Date: Thu, 13 Sep 2012 19:54:15 GMT
< Content-Type: application/x-git-receive-pack-advertisement
< Transfer-Encoding: chunked
< 
* Connection #0 to host bitbucket.org left intact
Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 921 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
* Couldn't find host bitbucket.org in the .netrc file; using defaults
* About to connect() to bitbucket.org port 443 (#0)
*   Trying 207.223.240.181...
* connected
* Connected to bitbucket.org (207.223.240.181) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt
  CApath: none
* SSL re-using session ID
* SSL connection using AES256-SHA
* old SSL session ID is stale, removing
* Server certificate:
* 	 subject: businessCategory=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=3928449; street=375 Alabama St Ste 325; postalCode=94110; C=US; ST=CA; L=San Francisco; O=Atlassian, Inc.; CN=bitbucket.org
* 	 start date: 2012-01-03 00:00:00 GMT
* 	 expire date: 2014-03-12 12:00:00 GMT
* 	 subjectAltName: bitbucket.org matched
* 	 issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance EV CA-1
* 	 SSL certificate verify ok.
* Server auth using Digest with user 'username'
> POST /username/public_test.git/git-receive-pack HTTP/1.1
Authorization: Digest username="username", realm="Bitbucket.org HTTP", nonce="xxxxxx", uri="/username/public_test.git/git-receive-pack", cnonce="xxxxxx", nc=00000002, qop="auth", response="xxxxxx", opaque="xxxxxxx"
User-Agent: git/1.7.11.2
Host: bitbucket.org
Accept-Encoding: deflate, gzip
Content-Type: application/x-git-receive-pack-request
Accept: application/x-git-receive-pack-result
Content-Length: 1057
* upload completely sent off: 1057 out of 1057 bytes
< HTTP/1.1 200 OK
< Server: nginx/1.0.6
< Date: Thu, 13 Sep 2012 19:54:22 GMT
< Content-Type: application/x-git-receive-pack-result
< Transfer-Encoding: chunked
< 
* Connection #0 to host bitbucket.org left intact
remote: bb/acl: username is allowed. accepted payload.
To https://username@bitbucket.org/username/public_test.git
   8d8254e..166a203  master -> master
* Closing connection #0

 

ソリューション

There may not be a solution for all users who encounter this issue as it is network related and can be affected by a variety of factors outside of the Bitbucket Cloud site's control.

 

 

最終更新日 2016 年 3 月 30 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.