2013-01-23 36 views
7

我試圖推動一些更改,但git push掛起。當我運行git push時,我看不到任何輸出,也沒有任何事情發生。 top沒有任何活動,也沒有任何發生的跡象。git push在HTTP/1.1之後掛起(啞巴)https 100繼續

我不控制git託管服務。我正在使用HTTPS網址。我相信託管服務使用啞HTTPS,而不是git的「智能HTTP」協議。在客戶端,我使用Mac OS X,並且通過Homebrew安裝了git 1.8.1.1(但使用包含在Xcode命令行工具中的git版本似乎沒有什麼區別)。註銷並重新登錄似乎沒有幫助。我可以從一個不同的Linux機器上推送到這個託管服務/存儲庫。

下面是一些調試輸出,顯示git push掛客戶端發出後PROPFIND請求時,從服務器獲取一個HTTP/1.1 100 Continue響應,然後什麼也沒有發生:它只是卡住了。

我如何得到這個工作?有沒有可以嘗試的故障排除步驟?

$ GIT_CURL_VERBOSE=1 git push -v 
Pushing to https://secure2.svnrepository.com/redacted/redacted/ 
* About to connect() to secure2.svnrepository.com port 443 (#0) 
* Trying 67.228.18.88... 
* Connected to secure2.svnrepository.com (67.228.18.88) port 443 (#0) 
* Connected to secure2.svnrepository.com (67.228.18.88) port 443 (#0) 
* SSL connection using DHE-RSA-AES256-SHA 
* Server certificate: 
* subject: C=US; OU=Domain Control Validated; CN=secure2.svnrepository.com 
* start date: 2012-01-09 16:16:59 GMT 
* expire date: 2015-02-09 02:52:45 GMT 
* subjectAltName: secure2.svnrepository.com matched 
* issuer: O=AlphaSSL; CN=AlphaSSL CA - G2 
* SSL certificate verify ok. 
> GET /redacted/redacted/info/refs?service=git-receive-pack HTTP/1.1 
User-Agent: git/1.8.1.1 
Host: secure2.svnrepository.com 
Accept: */* 
Accept-Encoding: gzip 
Pragma: no-cache 

< HTTP/1.1 401 Authorization Required 
< Date: Wed, 23 Jan 2013 03:29:36 GMT 
< Server: Apache/2.2.3 (Red Hat) 
< WWW-Authenticate: Basic realm="redacted" 
< Content-Length: 493 
< Content-Type: text/html; charset=iso-8859-1 
< 
* Ignoring the response-body 
* Connection #0 to host secure2.svnrepository.com left intact 
* Issue another request to this URL: 'https://secure2.svnrepository.com/redacted/redacted/info/refs?service=git-receive-pack' 
* Re-using existing connection! (#0) with host (nil) 
* Connected to (nil) (67.228.18.88) port 443 (#0) 
* Server auth using Basic with user 'redacted' 
> GET /redacted/redacted/info/refs?service=git-receive-pack HTTP/1.1 
Authorization: Basic redacted= 
User-Agent: git/1.8.1.1 
Host: secure2.svnrepository.com 
Accept: */* 
Accept-Encoding: gzip 
Pragma: no-cache 

< HTTP/1.1 200 OK 
< Date: Wed, 23 Jan 2013 03:29:36 GMT 
< Server: Apache/2.2.3 (Red Hat) 
< Last-Modified: Wed, 23 Jan 2013 03:00:40 GMT 
< ETag: "143802e-3b-e6374600" 
< Accept-Ranges: bytes 
< Content-Length: 59 
< Content-Type: text/plain; charset=UTF-8 
< 
* Connection #0 to host (nil) left intact 
* Re-using existing connection! (#0) with host (nil) 
* Connected to (nil) (67.228.18.88) port 443 (#0) 
* Server auth using Basic with user 'redacted' 
> GET /redacted/redacted/HEAD HTTP/1.1 
Authorization: Basic redacted= 
User-Agent: git/1.8.1.1 
Host: secure2.svnrepository.com 
Accept: */* 
Accept-Encoding: gzip 
Pragma: no-cache 

< HTTP/1.1 200 OK 
< Date: Wed, 23 Jan 2013 03:29:36 GMT 
< Server: Apache/2.2.3 (Red Hat) 
< Last-Modified: Wed, 16 Jan 2013 21:05:31 GMT 
< ETag: "d1802c-17-3d0d7cc0" 
< Accept-Ranges: bytes 
< Content-Length: 23 
< Content-Type: text/plain; charset=UTF-8 
< 
* Connection #0 to host (nil) left intact 
* About to connect() to secure2.svnrepository.com port 443 (#0) 
* Trying 67.228.18.88... 
* Connected to secure2.svnrepository.com (67.228.18.88) port 443 (#0) 
* Connected to secure2.svnrepository.com (67.228.18.88) port 443 (#0) 
* SSL connection using DHE-RSA-AES256-SHA 
* Server certificate: 
* subject: C=US; OU=Domain Control Validated; CN=secure2.svnrepository.com 
* start date: 2012-01-09 16:16:59 GMT 
* expire date: 2015-02-09 02:52:45 GMT 
* subjectAltName: secure2.svnrepository.com matched 
* issuer: O=AlphaSSL; CN=AlphaSSL CA - G2 
* SSL certificate verify ok. 
> PROPFIND /redacted/redacted/ HTTP/1.1 
User-Agent: git/1.8.1.1 
Host: secure2.svnrepository.com 
Accept: */* 
Depth: 0 
Content-Type: text/xml 
Content-Length: 181 
Expect: 100-continue 

< HTTP/1.1 100 Continue 
* We are completely uploaded and fine 
< HTTP/1.1 401 Authorization Required 
< Date: Wed, 23 Jan 2013 03:29:37 GMT 
< Server: Apache/2.2.3 (Red Hat) 
< WWW-Authenticate: Basic realm="redacted" 
< Content-Length: 493 
< Content-Type: text/html; charset=iso-8859-1 
* the ioctl callback returned 0 
< 
* Ignoring the response-body 
* Connection #0 to host secure2.svnrepository.com left intact 
* Issue another request to this URL: 'https://secure2.svnrepository.com/redacted/redacted/' 
* Re-using existing connection! (#0) with host (nil) 
* Connected to (nil) (67.228.18.88) port 443 (#0) 
* Server auth using Basic with user 'redacted' 
> PROPFIND /redacted/redacted/ HTTP/1.1 
Authorization: Basic redacted= 
User-Agent: git/1.8.1.1 
Host: secure2.svnrepository.com 
Accept: */* 
Depth: 0 
Content-Type: text/xml 
Content-Length: 181 
Expect: 100-continue 

< HTTP/1.1 100 Continue 

我沒有我的Mac OS X機上strace,我無法弄清楚如何使用dtruss哪些系統調用它掛在因爲dtruss需要我是根目錄,然後git push會以不同的方式工作。

更新:我已經在git 1.8.1.4和strace的Linux機器上重現了這一點。在後臺運行strace顯示類似於下面的東西它掛之前:

sendto(4, <redacted>..., 314, 0, NULL, 0) = 314 
recvfrom(4, "\27\3\1\0000", 5, 0, NULL, NULL) = 5 
recvfrom(4, "E\202\271\21\236p\200\346\374\3641\355\t\275\rLi\202T)\326\271l/\351\f\357\2769Jb\22"..., 48, 0, NULL, NULL) = 48 
select(5, [4], [4], [], {0, 729000}) = 1 (out [4], left {0, 728997}) 
poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=4, events=POLLOUT|POLLWRNORM}], 2, 0) = 1 ([{fd=4, revents=POLLOUT|POLLWRNORM}]) 
select(5, [4], [], [], {0, 729000}) = 0 (Timeout) 
poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout) 
...last 2 lines repeat infinitely... 

所以它似乎是掛期待從服務器接收的東西。

另外,我嘗試過類似的跟蹤與GIT_CURL_VERBOSE=1 git push -v上運行git 1.7.4.4舊的Linux機器,它具有相同前綴開始,然後從那裏繼續進行。在破碎機與新的git:

$ grep '^> [A-Z]' git-1.8.1.1-trace.stderr 
> GET /redacted/redacted/info/refs?service=git-receive-pack HTTP/1.1 
> GET /redacted/redacted/info/refs?service=git-receive-pack HTTP/1.1 
> GET /redacted/redacted/HEAD HTTP/1.1 
> PROPFIND /redacted/redacted/ HTTP/1.1 
> PROPFIND /redacted/redacted/ HTTP/1.1 

在舊機器與舊混帳,在它的所有工作:

$ grep '^> [A-Z]' git-1.7.4.4-trace.stderr 
> GET /g_wagner/c79-s13/info/refs?service=git-receive-pack HTTP/1.1 
> GET /g_wagner/c79-s13/info/refs?service=git-receive-pack HTTP/1.1 
> GET /g_wagner/c79-s13/HEAD HTTP/1.1 
> PROPFIND /g_wagner/c79-s13/ HTTP/1.1 
> PROPFIND /g_wagner/c79-s13/ HTTP/1.1 
> HEAD /g_wagner/c79-s13/info/refs HTTP/1.1 
> HEAD /g_wagner/c79-s13/objects/info/packs HTTP/1.1 
> MKCOL /g_wagner/c79-s13/info/ HTTP/1.1 
> LOCK /g_wagner/c79-s13/info/refs HTTP/1.1 
> GET /g_wagner/c79-s13/objects/info/packs HTTP/1.1 
... 
> UNLOCK /g_wagner/c79-s13/info/refs HTTP/1.1 

看着在兩臺機器上的全部跟蹤,我不能查看有問題的PROPFIND請求(第二個PROPFIND)中發送的內容的差異:除User-Agent:標題外,兩個請求看起來都是相同的。

+0

' cjc343

+0

謝謝,@ cjc343。有關如何進一步排除故障的任何提示?我正在使用'〜/ .netrc'進行身份驗證,並且我確認我的'〜/ .netrc'與其他(Linux)機器上的值完全相同,我沒有問題。此外,我能夠從這臺機器上成功拉出,這也需要認證證書 - 所以這一切都非常令人費解。 –

+0

這的確很奇怪...不幸的是,我對http/s的git不是很熟悉,因爲我一直使用ssh進行身份驗證。除非意外地將拉取權限打開,否則無法推送並拋出大部分可能性,例如'.netrc'的權限過於開放或包含在遠程中的用戶名(我想這會顯示如果是這種情況,則在上面),在窗外。如果你添加一個包含用戶名的遠程服務器,git會在推送時提示你輸入密碼(它應該)?希望別人有更好的想法是什麼問題... – cjc343

回答

2

我有問題,相同的症狀(進程掛在HTTP/1.1 100 Continue)。

我發現了一個可以爲我解決問題的提交:http-push.c: make CURLOPT_IOCTLDATA a usable pointer,它在GIT版本v2.0.3中可用。

顯然用戶沒有在服務器上正確認證,即使它似乎是從通信。

問題很奇怪,因爲對於你來說,它顯示在一臺機器上,但沒有顯示在安裝了相同GIT版本的另一臺機器上,對我而言,GIT在一個月的時間內停止工作,我無法真正說出原因。

或者,如果可能的話,使用允許其他協議的GIT服務提供程序:SSH或HTTPS,這些更好地被調試。


對於Windows用戶,這是我拿上git-http-push 2.1.0-rc2版本(基於msysGit project instructions

要反向移植到您的msysGit安裝,解壓縮,並在msysGit安裝文件夾複製到/覆蓋libexec\git-core\git-http-push.exe

該問題已被舉報here

更新

最新msysGit(GIT-1.9.4-preview20140815)包含回遷修正錯誤。