2016-01-13 79 views
0

我目前正在試圖克隆從TFS存儲庫在我的Mac,但得到以下錯誤:來自TFS的Git克隆錯誤:RPC失敗;結果= 22,HTTP代碼= 401

$ git clone https://tfs.xx.com/yy/_git/Mobile 
Cloning into 'Mobile'... 
Username for 'https://tfs.xx.com': xxx 
Password for 'https://[email protected]': 
error: RPC failed; result=22, HTTP code = 401 
fatal: The remote end hung up unexpectedly 

環境:

  • 的Mac OS X EI上尉好版本10.11.1
  • Git的2.3.8(蘋果的Git-58)
  • TFS 2015年

搜索了幾種可能的解決方案,但都失敗了。在安全鑰匙扣

  1. 增加HTTP POST緩衝

    混帳配置--global http.postBuffer 524288000

  2. 緩存憑據

    混帳配置--global credential.helper osxkeychain

  3. 將git升級到最新版本v2.6.4(失敗後卸載)

我懷疑根情況可能是TFS服務器上的驗證配置。 TFS服務器塊訪問不基於窗口的NTLM。這樣說,我的證據是,當我運行git與GIT_CURL_VERBOSE = 1。它顯示了更多細節,並在日誌結尾。還有消息:

* NTLM handshake rejected 
* Authentication problem. Ignoring this. 

在Mac上的細節記錄的一部分:

$ GIT_CURL_VERBOSE=1 git clone https://tfs.xx.com/yy/_git/Mobile 
Cloning into 'Mobile'... 
................... 
* upload completely sent off: 154 out of 154 bytes 
< HTTP/1.1 401 Unauthorized 
< Content-Type: text/html 
< Server: Microsoft-IIS/8.0 
< X-TFS-ProcessId: f00df4b5-6907-4ccd-818c-773f01ee3961 
< X-FRAME-OPTIONS: SAMEORIGIN 
< Access-Control-Allow-Origin: * 
< Access-Control-Max-Age: 3600 
< Access-Control-Allow-Methods: OPTIONS,GET,POST,PATCH,PUT,DELETE 
< Access-Control-Expose-Headers: ActivityId,X-TFS-Session 
< Access-Control-Allow-Headers: authorization 
< Set-Cookie: Tfs-SessionId=d13bcac7-856f-4435-b94b-b2f2d24b2dd1; path=/ 
< Set-Cookie: Tfs-SessionActive=2016-01-13T06:01:32; path=/ 
* NTLM handshake rejected 
* Authentication problem. Ignoring this. 
< WWW-Authenticate: NTLM 
< X-Powered-By: ASP.NET 
< P3P: CP="CAO DSP COR ADMa DEV CONo TELo CUR PSA PSD TAI IVDo OUR SAMi BUS DEM NAV STA UNI COM INT PHY ONL FIN PUR LOC CNT" 
< X-Content-Type-Options: nosniff 
< Date: Wed, 13 Jan 2016 06:01:31 GMT 
< Content-Length: 842 
< Vary: Accept-Encoding 
< Content-Encoding: gzip 
< Age: 1 
< Connection: keep-alive 
< Via: 1.1 akamai (ACE 5.4.0/5.4.0) 
* The requested URL returned error: 401 
* Closing connection 1 
error: RPC failed; result=22, HTTP code = 401 
fatal: The remote end hung up unexpectedly 

好吧,當我在Windows上稱爲相同的命令。它正確執行。區別在於窗戶顯示:

* NTLM auth restarted 

並繼續。 雖然Mac迴應:

* NTLM handshake rejected 
* Authentication problem. Ignoring this 

,然後停止。

詳細的日誌在Windows的一部分

$ GIT_CURL_VERBOSE=1 git clone https://tfs.xx.com/yy/_git/Mobile 
Cloning into 'Mobile'... 
................... 
* upload completely sent off: 154 out of 154 bytes 
< HTTP/1.1 401 Unauthorized 
< Content-Type: text/html 
< Server: Microsoft-IIS/8.0 
< X-TFS-ProcessId: f00df4b5-6907-4ccd-818c-773f01ee3961 
< X-FRAME-OPTIONS: SAMEORIGIN 
< Access-Control-Allow-Origin: * 
< Access-Control-Max-Age: 3600 
< Access-Control-Allow-Methods: OPTIONS,GET,POST,PATCH,PUT,DELETE 
< Access-Control-Expose-Headers: ActivityId,X-TFS-Session 
< Access-Control-Allow-Headers: authorization 
< Set-Cookie: Tfs-SessionId=544cda47-3165-4087-ac40-324936afcb41; path=/ 
< Set-Cookie: Tfs-SessionActive=2016-01-13T07:30:30; path=/ 
* NTLM auth restarted 
< WWW-Authenticate: NTLM 
< X-Powered-By: ASP.NET 
< P3P: CP="CAO DSP COR ADMa DEV CONo TELo CUR PSA PSD TAI IVDo OUR SAMi BUS DEM NAV STA UNI COM INT PHY ONL FIN PUR LOC CNT" 
< X-Content-Type-Options: nosniff 
< Date: Wed, 13 Jan 2016 07:30:30 GMT 
< Content-Length: 842 
< Vary: Accept-Encoding 
< Content-Encoding: gzip 
< Age: 0 
< Connection: keep-alive 
< Via: 1.1 akamai (ACE 5.4.0/5.4.0) 
< 
* Ignoring the response-body 
* Connection #1 to host tfs.xx.com left intact 
* Issue another request to this URL: 'https://tfs.xx.com/yy/_git/Mobile/git-upload-pack' 
* Couldn't find host tfs.xx.com in the _netrc file; using defaults 
* Found bundle for host tfs.xx.com: 0x5a0b70 
* Re-using existing connection! (#1) with host tfs.xx.com 
* Connected to tfs.xx.com (199.6.147.240) port 443 (#1) 
* Server auth using NTLM with user 'szhao8' 
> POST /yy/_git/Mobile/git-upload-pack HTTP/1.1 
Host: tfs.xx.com 
Authorization: NTLM *************************************************== 
User-Agent: git/2.6.4.windows.1 
Accept-Encoding: gzip 
Content-Type: application/x-git-upload-pack-request 
Accept: application/x-git-upload-pack-result 
Content-Length: 0 
................... 
< 
remote: 
remote:     fTfs 
remote:     fSSSSSSSs 
remote:    fSSSSSSSSSS 
remote: TSSf   fSSSSSSSSSSSS 
remote: SSSSSF  fSSSSSSST SSSSS 
remote: SSfSSSSSsfSSSSSSSt SSSSS 
remote: SS tSSSSSSSSSs  SSSSS 
remote: SS fSSSSSSST  SSSSS 
remote: SS fSSSSSFSSSSSSf SSSSS 
remote: SSSSSST FSSSSSSFt SSSSS 
remote: SSSSt  FSSSSSSSSSSSS 
remote:    FSSSSSSSSSS 
remote:     FSSSSSSs 
remote:     FSFs (TM) 
remote: 
remote: Microsoft (R) Visual Studio (R) Team Foundation Server 
remote: 
* Connection #1 to host tfs.xx.com left intact| 5.52 MiB/s 
Receiving objects: 100% (5768/5768), 31.25 MiB | 5.98 MiB/s, done. 
Resolving deltas: 100% (3937/3937), done. 
Checking connectivity... done. 
Checking out files: 100% (1005/1005), done. 

是否有任何人之前達到這個問題?感謝您的反饋!

+0

有一段時間由於網絡速度較慢而發生此問題。 –

+0

感謝您的提醒!網絡速度非常慢。我會嘗試更好的網絡環境。 – Tonkon

+0

@anandmishra你是對的。這似乎是由於網絡速度緩慢。它今天再次運作。 – Tonkon

回答

1

由於網絡速度較慢,發生此問題的時間有限。請嘗試以更好的網絡速度克隆存儲庫。

相關問題