2016-11-15 146 views
0

儘管試圖克隆一個倉庫,我收到以下錯誤: -無法克隆庫

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

我使用HTTPS連接,如果該信息是使用。

我曾嘗試: -

git config --global http.postBuffer 524288000 

這因此未鍛鍊。

的附加細節: - OS - Ubuntu的14.04, git倉庫 - 到位桶, git的版本 - 1.9.1

編輯: -

結果從: - GIT_CURL_VERBOSE = 1 GIT_TRACE_PACKET = 1 GIT中克隆URL

GIT_CURL_VERBOSE=1 GIT_TRACE_PACKET=1 git clone <https:url> 
Cloning into 'reponame'... 
* Couldn't find host bitbucket.org in the .netrc file; using defaults 
* Hostname was NOT found in DNS cache 
* Trying 104.192.143.2... 
* Connected to bitbucket.org (104.192.143.2) port 443 (#0) 
* found 173 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: Tue, 03 May 2016 00:00:00 GMT 

*  expire date: Fri, 22 Jun 2018 12:00:00 GMT 

*  issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 Extended Validation Server CA 
*  compression: NULL 
*  cipher: AES-128-CBC 
*  MAC: SHA256 
> GET reponame.git/info/refs?service=git-upload-pack HTTP/1.1 
User-Agent: git/1.9.1 
Host: bitbucket.org 
Accept: */* 
Accept-Encoding: gzip 
Pragma: no-cache 

< HTTP/1.1 401 Unauthorized 
< WWW-Authenticate: Basic realm="Bitbucket.org HTTP" 
< Content-Type: text/plain 
< Date: Tue, 15 Nov 2016 09:31:20 GMT 
< X-Git-Mode: pull 
< Connection: Keep-Alive 
< Content-Length: 12 
< 
* Ignoring the response-body 
* Connection #0 to host bitbucket.org left intact 
* Issue another request to this URL: '<url here>/info/refs?service=git-upload-pack' 
* Couldn't find host bitbucket.org in the .netrc file; using defaults 
* Found bundle for host bitbucket.org: 0xb5e5f0 
* Re-using existing connection! (#0) with host bitbucket.org 
* Connected to bitbucket.org (104.192.143.2) port 443 (#0) 
* Server auth using Basic with user 'user_name' 
> GET /reponame/info/refs?service=git-upload-pack HTTP/1.1 
Authorization: Basic c3JlZWthbnRoX25jOg== 
User-Agent: git/1.9.1 
Host: bitbucket.org 
Accept: */* 
Accept-Encoding: gzip 
Pragma: no-cache 

< HTTP/1.1 401 Unauthorized 
* Server nginx/1.6.2 is not blacklisted 
< Server: nginx/1.6.2 
* Authentication problem. Ignoring this. 
< WWW-Authenticate: Basic realm="Bitbucket.org HTTP" 
< Vary: Accept-Encoding 
< Cache-Control: no-cache 
< Content-Type: text/plain 
< X-Usage-Output-Ops: 0 
< Content-Encoding: gzip 
< Strict-Transport-Security: max-age=31536000 
< Date: Tue, 15 Nov 2016 09:31:21 GMT 
< X-Usage-User-Time: 0.009855 
< X-Usage-System-Time: 0.003753 
< Transfer-Encoding: chunked 
< X-View-Name: bitbucket.gitweb.application 
< Connection: Closed 
< X-Usage-Input-Ops: 0 
< 
* Closing connection 0 
Password for <url here> 
* Couldn't find host bitbucket.org in the .netrc file; using defaults 
* Hostname was found in DNS cache 
* Trying 104.192.143.2... 
* Connected to bitbucket.org (104.192.143.2) port 443 (#1) 
* found 173 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: Tue, 03 May 2016 00:00:00 GMT 

*  expire date: Fri, 22 Jun 2018 12:00:00 GMT 

*  issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 Extended Validation Server CA 
*  compression: NULL 
*  cipher: AES-128-CBC 
*  MAC: SHA256 
* Server auth using Basic with user 'username' 
> GET /reponame.git/info/refs?service=git-upload-pack HTTP/1.1 
Authorization: Basic c3JlZWthbnRoX25jOnNyZWVrYW50aGhlcmU= 
User-Agent: git/1.9.1 
Host: bitbucket.org 
Accept: */* 
Accept-Encoding: gzip 
Pragma: no-cache 

< HTTP/1.1 200 OK 
< bbr1wikiprivate: 0 
< bbr1private: 1 
* Server nginx/1.6.2 is not blacklisted 
< Server: nginx/1.6.2 
< Cache-Control: no-cache 
< Content-Type: application/x-git-upload-pack-advertisement 
< X-Usage-Output-Ops: 0 
< bbr1reposlug: reponame 
< bbr1hasadmin: 0 
< bbr1scm: git 
< Strict-Transport-Security: max-age=31536000 
< Date: Tue, 15 Nov 2016 09:31:37 GMT 
< X-Usage-User-Time: 0.016693 
< X-Usage-System-Time: 0.004990 
< bbuserid: 5740059 
< Transfer-Encoding: chunked 
< bbr1hasread: 1 
< bbr1ownerid: 5057159 
< bbr1issuesprivate: 0 
< bbr1haswrite: 1 
< bbr1size: 896834063 
< X-View-Name: bitbucket.gitweb.application 
< Connection: Closed 
< bbusername: user_name 
< X-Usage-Input-Ops: 0 
< bbr1owner: reponame 
< bbr1id: 15508590 
< 
* Closing connection 1 
packet:   git< # service=git-upload-pack 
packet:   git< 0000 
packet:   git< be49ca012c0752031ced115cdad0af02931de2d0 HEAD\0multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master agent=git/2.7.4.1.g5468f9e 
packet:   git< 36b228cb4d33d30cd536e7faddca8dc9c32e99fa refs/heads/develop 
packet:   git< be49ca012c0752031ced115cdad0af02931de2d0 refs/heads/master 
packet:   git< 0000 
packet:   git> be49ca012c0752031ced115cdad0af02931de2d0 HEAD 
packet:   git> 36b228cb4d33d30cd536e7faddca8dc9c32e99fa refs/heads/develop 
packet:   git> be49ca012c0752031ced115cdad0af02931de2d0 refs/heads/master 
packet:   git> 0000 
packet: fetch-pack< be49ca012c0752031ced115cdad0af02931de2d0 HEAD 
packet: fetch-pack< 36b228cb4d33d30cd536e7faddca8dc9c32e99fa refs/heads/develop 
packet: fetch-pack< be49ca012c0752031ced115cdad0af02931de2d0 refs/heads/master 
packet: fetch-pack< 0000 
packet: fetch-pack< be49ca012c0752031ced115cdad0af02931de2d0 HEAD\0multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master agent=git/2.7.4.1.g5468f9e 
packet: fetch-pack< 36b228cb4d33d30cd536e7faddca8dc9c32e99fa refs/heads/develop 
packet: fetch-pack< be49ca012c0752031ced115cdad0af02931de2d0 refs/heads/master 
packet: fetch-pack< 0000 
packet: fetch-pack> want be49ca012c0752031ced115cdad0af02931de2d0 multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/1.9.1 
packet: fetch-pack> want 36b228cb4d33d30cd536e7faddca8dc9c32e99fa 
packet: fetch-pack> want be49ca012c0752031ced115cdad0af02931de2d0 
packet: fetch-pack> 0000 
packet: fetch-pack> done 
packet: fetch-pack> 0000 
packet:   git< 007fwant be49ca012c0752031ced115cdad0af02931de2d0 multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/1.9.10032want 36b228cb4d33d30cd536e7faddca8dc9c32e99fa0032want be49ca012c0752031ced115cdad0af02931de2d000000009done 
packet:   git< 0000 
* Couldn't find host bitbucket.org in the .netrc file; using defaults 
* Hostname was NOT found in DNS cache 
* Trying 104.192.143.2... 
* Connected to bitbucket.org (104.192.143.2) port 443 (#2) 
* found 173 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: Tue, 03 May 2016 00:00:00 GMT 

*  expire date: Fri, 22 Jun 2018 12:00:00 GMT 

*  issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 Extended Validation Server CA 
*  compression: NULL 
*  cipher: AES-128-CBC 
*  MAC: SHA256 
* Server auth using Basic with user '<user name>' 
> POST /reponame.git/git-upload-pack HTTP/1.1 
Authorization: Basic c3JlZWthbnRoX25jOnNyZWVrYW50aGhlcmU= 
User-Agent: git/1.9.1 
Host: bitbucket.org 
Accept-Encoding: gzip 
Content-Type: application/x-git-upload-pack-request 
Accept: application/x-git-upload-pack-result 
Content-Length: 240 

* upload completely sent off: 240 out of 240 bytes 
* GnuTLS recv error (-9): A TLS packet with unexpected length was received. 
* Closing connection 2 
error: RPC failed; result=56, HTTP code = 0 
fatal: The remote end hung up unexpectedly 
+2

你在哪個操作系統上使用什麼版本的Git?你的遠程回購是BitBucket嗎?一個GitHub嗎? – VonC

+0

你可以嘗試通過ssh克隆嗎? –

+1

你可以通過運行'GIT_CURL_VERBOSE = 1 GIT_TRACE_PACKET = 1 git clone URL'從git獲得額外的調試信息。這可能有助於更多地瞭解發生的事情。 – jszakmeister

回答

0

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

這意味着GIT中試圖執行HTTP歌劇使用libcurl庫,但操作意外失敗。因此,git報告由libcurl(「結果」)和HTTP錯誤代碼返回的錯誤代碼。

在這種情況下,HTTP錯誤代碼爲0,這通常意味着沒有收到HTTP錯誤代碼(這是一個小問題,它不應該列出HTTP代碼)。

libcurl錯誤代碼是52,根據the docs,這意味着:

CURLE_GOT_NOTHING (52) - Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.

因此,在總結:在HTTP調用,當一個預期的刪除服務器沒有響應。


要了解更多信息,您需要進一步調試。正如評論中所解釋的,一個好的選擇是在調用git時設置GIT_CURL_VERBOSE=1GIT_TRACE_PACKET=1 - 這將輸出額外的信息。

這可能是git服務器上的配置問題,或者您使用的是錯誤的URI。

+0

@SreekanthKarumanaghat:從日誌看來,實際上傳的變化(「upload-pack」)失敗,因爲服務器剛剛關閉連接。不幸的是,我不知道爲什麼會發生這種情況。 – sleske

+0

回購規模相當巨大。這可能是一個原因嗎? –

+0

任何我切換到ssh成功實現克隆的方式。 –