我目前正在尝试从我的Mac上的TFS克隆存储库,但得到以下错误:
$ git clone https://tfs.xx.com/yy/_git/Mobile
Cloning into 'Mobile'...
Username for 'https://tfs.xx.com': xxx
Password for 'https://xxx@tfs.xx.com':
error: RPC failed; result=22, HTTP code = 401
fatal: The remote end hung up unexpectedly
环境:
增加http post缓冲区
git config --global http.postBuffer 524288000
安全密钥链中的缓存凭据
git config --global credential.helper osxkeychain
将git升级到最新版本v2.6.4(失败后卸载)
我怀疑根案例可能是TFS服务器上的身份验证配置。 TFS服务器块访问不基于窗口的NTLM。这么说,我的证据是当我使用 GIT_CURL_VERBOSE = 1 运行git时。它显示了更多细节,并在日志的最后。有消息:
* 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 :(得分:1)
有些时候由于网速较慢而出现此问题。尝试以更好的网络速度克隆存储库。