error: RPC failed; result=22, 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=22, 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=22, HTTP code = 0

Specifically, the 'result=22' 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 22 means:

CURLE_HTTP_RETURNED_ERROR (22)
	This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400.

原因

This is likely an error with the Bitbucket Cloud service and should be reported immediately to support. The current support link can be found here.

To Help the Bitbucket Cloud Support Team Troubleshoot

To help the Bitbucket Cloud team resolve the issue for everyone, please 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

回避策

To get going immediately, you can typically switch to SSH. We have a guide to getting it setup for Git at Set up SSH for Git. If you should run into any configuration issues while setting up SSH, please refer to our SSH Troubleshooting guide.

 

 

最終更新日 2018 年 11 月 2 日

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

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