2016-01-13 87 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

由于网络速度较慢,发生此问题的时间有限。请尝试以更好的网络速度克隆存储库。