在HTTP / 1.1 100继续之后,git push挂在(哑巴)https上 [英] git push hangs over (dumb) https, after HTTP/1.1 100 Continue

查看:136
本文介绍了在HTTP / 1.1 100继续之后,git push挂在(哑巴)https上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图推进一些更改,但 git push 挂起。当我运行 git push 时,我看不到输出,也没有任何事情发生。在 top 中没有任何活动,并且没有任何事情发生。我不控制git托管服务。我正在使用HTTPS网址。我相信托管服务使用哑HTTPS,而不是git的智能HTTP协议。在客户端,我使用Mac OS X,并且通过Homebrew安装了git 1.8.1.1(但是使用包含在Xcode命令行工具中的git版本似乎没有什么区别)。注销并重新登录似乎没有帮助。我可以从一个不同的Linux机器上推送到这个托管服务/存储库。



下面是一些调试输出,它显示客户端发出PROPFIND请求后挂起 git push ,得到一个 HTTP / 1.1 100从服务器继续响应,然后没有任何反应:它只是被卡住了。



我如何得到这个加工?是否有任何疑难解答步骤,我可以尝试?

  $ GIT_CURL_VERBOSE = 1 git push -v 
推送到https: //secure2.svnrepository.com/redacted/redacted/
*关于连接()到secure2.svnrepository.com端口443(#0)
*尝试67.228.18.88 ...
*连接到secure2.svnrepository.com(67.228.18.88)端口443(#0)
*连接到secure2.svnrepository.com(67.228.18.88)端口443(#0)
*使用SSL连接DHE-RSA-AES256-SHA
*服务器证书:
*主题:C = US; OU =域控制验证; CN = secure2.svnrepository.com
*开始日期:2012-01-09 16:16:59 GMT
*过期日期:2015-02-09 02:52:45 GMT
* subjectAltName:secure2.svnrepository.com匹配
* issuer:O = AlphaSSL; CN = AlphaSSL CA - G2
* SSL证书确认无误。
> 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

< b< HTTP / 1.1 401需要授权
<日期:2013年1月23日星期三03:29:36 GMT
<服务器:Apache / 2.2.3(红帽)
< WWW-Authenticate:基本领域=redacted
<内容长度:493
<内容类型:text / html; charset = iso-8859-1
<
*忽略响应主体
*将#0连接到主机secure2.svnrepository.com保持原样
*向该URL发出另一个请求:'https://secure2.svnrepository.com/ redacted / redacted / info / refs?service = git-receive-pack'
*重新使用现有连接! (#0)
*连接到(无)(67.228.18.88)端口443(#0)
*使用基本用户'redacted'的服务器认证
> GET / redacted / redacted / info / refs?service = git-receive-pack HTTP / 1.1
授权:Basic redacted =
User-Agent:git / 1.8.1.1
Host:secure2。 svnrepository.com
Accept:* / *
Accept-Encoding:gzip
Pragma:no-cache

< b< HTTP / 1.1 200 OK
<日期:2013年1月23日星期三03:29:36 GMT
<服务器:Apache / 2.2.3(红帽)
< Last-Modified:Wed,23 Jan 2013 03:00:40 GMT
< ETag:143802e-3b-e6374600
< Accept-Ranges:bytes
<内容长度:59
<内容类型:text / plain; charset = UTF-8
<
*连接#0到主机(零)完好无损
*重新使用现有连接! (#0)
*连接到(无)(67.228.18.88)端口443(#0)
*使用基本用户'redacted'的服务器认证
> GET / redacted / redacted / HEAD HTTP / 1.1
授权:Basic redacted =
用户代理:git / 1.8.1.1
主机:secure2.svnrepository.com
接受:* / *
Accept-Encoding:gzip
Pragma:no-cache

< b< HTTP / 1.1 200 OK
<日期:2013年1月23日星期三03:29:36 GMT
<服务器:Apache / 2.2.3(红帽)
< Last-Modified:Wed,16 Jan 2013 21:05:31 GMT
< ETag:d1802c-17-3d0d7cc0
< Accept-Ranges:bytes
<内容长度:23
<内容类型:text / plain; charset = UTF-8
<
*连接#0到主机(nil)保持原样
*关于连接()到secure2.svnrepository.com端口443(#0)
*尝试67.228.18.88 ...
*连接到secure2.svnrepository.com(67.228.18.88)端口443(#0)
*连接到secure2.svnrepository.com(67.228.18.88)端口443(#0)
* SSL连接使用DHE-RSA-AES256-SHA
*服务器证书:
* subject:C = US; OU =域控制验证; CN = secure2.svnrepository.com
*开始日期:2012-01-09 16:16:59 GMT
*过期日期:2015-02-09 02:52:45 GMT
* subjectAltName:secure2.svnrepository.com匹配
* issuer:O = AlphaSSL; CN = AlphaSSL CA - G2
* SSL证书确认无误。
> PROPFIND / redacted / redacted / HTTP / 1.1
用户代理:git / 1.8.1.1
主机:secure2.svnrepository.com
接受:* / *
深度:0
Content-Type:text / xml
Content-Length:181
Expect:100-continue

< b< HTTP / 1.1 100继续
*我们完全上传并罚款
< HTTP / 1.1 401需要授权
<日期:Wed,23 Jan 2013 03:29:37 GMT
<服务器:Apache / 2.2.3(红帽)
< WWW-Authenticate:基本领域=redacted
<内容长度:493
<内容类型:text / html; charset = iso-8859-1
* ioctl回调返回0
<
*忽略响应主体
*将#0连接到主机secure2.svnrepository.com保持原样
*向该URL发出另一个请求:'https://secure2.svnrepository.com/编辑/编辑/'
*重新使用现有连接! (#0)
*连接到(无)(67.228.18.88)端口443(#0)
*使用基本用户'redacted'的服务器认证
> PROPFIND / redacted / redacted / HTTP / 1.1
授权:基本编辑=
用户代理:git / 1.8.1.1
主机:secure2.svnrepository.com
接受:* / *
深度:0
内容类型:text / xml
内容长度:181
期望值:100-继续

< b< HTTP / 1.1 100继续

我没有 strace 在我的Mac OS X机器上,我找不到如何使用 dtruss 来查看挂载的系统调用,因为 dtruss 要求我是root用户,然后git push会以不同的方式工作。

更新:我已经在一台Linux机器上用git 1.8.1.4和strace。运行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(出[4],左{0,728997})
轮询([{FD = 4,事件= POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND},{FD = 4,事件= POLLOUT | POLLWRNORM }],2,0)= 1([{fd = 4,revents = POLLOUT | POLLWRNORM}])
select(5,[4],[],[],{0,729000})= 0 (超时)
poll([{fd = 4,events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND}],1,0)= 0(超时)
...最后2行重复无限.. 。

所以它似乎预计会从服务器接收一些信息。



另外,我尝试了在运行git 1.7.4.4的旧版Linux机器上运行一个类似于 GIT_CURL_VERBOSE = 1 git push -v 的跟踪,它以相同的前缀开始,然后从那里继续。在新的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

在使用旧版git的旧机器上, working:

  $ 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: header。

解决方案

我遇到同样症状的问题(进程挂在 HTTP / 1.1 100继续)。



我发现了一个可以解决这个问题的提交: HTTP-push.c:使CURLOPT_IOCTLDATA一个可用指针时,它在<强> GIT释放V2.0.3可用

显然用户在服务器上没有被正确认证,即使它看起来如此。



问题很奇怪,因为对你来说,它显示在一台机器上,但没有安装在同一个GIT版本上,对我来说GIT在一个月的时间内停止工作,我不能说真的是什么原因。



或者,如果可能的话,使用GIT服务提供者,允许其他人协议:SSH或HTTPS,这些都更好地调试。






对于windows用户,这里是我的 git-http-push 2.1.0-rc2 build(基于



要将您的 msysGit 安装解压缩并安装到msysGit中文件夹复制到/覆盖 libexec \ git-core \ git-http-push.exe



问题已有报道此处



更新



最新的 msysGit (Git-1.9.4-preview20140815)包含backported bugfix。


I'm trying to push some changes, but git push hangs. When I run git push, I see no output, and nothing seems to be happening. There's no activity in top, and no sign of anything happening.

I do not control the git hosting service. I'm using a HTTPS URL. I believe the hosting service is using dumb HTTPS, not git's "smart-HTTP" protocol. On the client side, I use Mac OS X, and I've got git 1.8.1.1 installed via Homebrew (but using the version of git included in Xcode's command-line tools doesn't seem to make a difference). Logging out and logging back in doesn't seem to help. I can pull and push to this hosting service/repository from a different Linux box.

Below is some debugging output that shows git push hanging after the client issues a PROPFIND request, gets a HTTP/1.1 100 Continue response from the server, and then nothing happens: it's just stuck.

How do I get this working? Are there any troubleshooting steps that I can try?

$ 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

I don't have strace on my Mac OS X machine, and I can't figure out how to use dtruss to see what system calls it is hanging on because dtruss requires me to be root, and then git push will work differently.

Update: I've reproduced this on a Linux machine with git 1.8.1.4 and with strace. Running strace shows something like the following before it hangs:

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...

So it seems to be hanging expecting to receive something from the server.

Also, I tried a similar trace with GIT_CURL_VERBOSE=1 git push -v on an older Linux box running git 1.7.4.4, and it starts with the same prefix and then continues on from there. On the broken machine with the newer 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

On the older machine with the older git, where it's all working:

$ 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

Looking at the full trace on both machines, I can't see any difference in what is sent in the problematic PROPFIND request (the 2nd PROPFIND): both requests appear to be identical, except for the User-Agent: header.

解决方案

I've got problem with same symptoms (process hangs at HTTP/1.1 100 Continue).

I've found a commit that resolves the issue for me: http-push.c: make CURLOPT_IOCTLDATA a usable pointer, it's available in GIT release v2.0.3.

Apparently user is not being authenticated correctly on server even it does seems so from the communication.

Problem is weird, because for you it shows up on one machine but not on another with same GIT versions installed, for me GIT just stopped working within period of one month and I can't really say what was the cause.

Alternatively if it's possible, use GIT service provider that allows other protocols: SSH or HTTPS, these are much better debugged.


For windows users, here's my take on git-http-push 2.1.0-rc2 build (based on msysGit project instructions)

To backport to your msysGit installation, unzip it and in msysGit installation folder copy into/ overwrite libexec\git-core\git-http-push.exe.

The issue has been reported here.

Update

Latest msysGit (Git-1.9.4-preview20140815) contains backported bugfix.

这篇关于在HTTP / 1.1 100继续之后,git push挂在(哑巴)https上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆