Git:在CONNECT之后从代理收到HTTP代码503

时间:2015-07-23 13:30:32

标签: git intellij-idea proxy atlassian-sourcetree http-status-code-503

我查了很多与此问题相关的帖子,但似乎没有什么能解决我的问题。所以现在我希望你们能给我一个神奇的答案。

我使用Intellij(但也尝试使用SourceTree)从Fisheye拉/推/克隆存储库。但是我收到了错误:

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin

fatal: unable to access 'https://myUser@myUrl/fisheye/git/myRepo.git/': Received HTTP code 503 from proxy after CONNECT

关于503的提示意味着因维护而暂时停工对我不起作用,因为这个问题持续了一个星期。

有关错误/丢失代理设置的提示似乎也无效。我为系统git和IDE(Intellij)设置了http和https代理。

之前有效,我能够克隆存储库。然后我创建了一个新分支,进行了一些更改,并希望将其推回到主服务器。

我真的很期待一些聪明的提示。

到目前为止感谢

更新

我补充说:

export GIT_TRACE_PACKET=1 export GIT_TRACE=1 export GIT_CURL_VERBOSE=1

我收到了以下日志

$ git fetch
trace: built-in: git 'fetch'
trace: run_command: 'git-remote-https' 'origin' 'https://Username@myWebService.de/randomGit.git/'
* Couldn't find host myWebService in the _netrc file; using defaults
*   Trying 15.46.16.11...
* Connected to myProxy.com (15.46.16.11) port 8080 (#0)
* Establish HTTP proxy tunnel to myWebService.de:443
> CONNECT myWebService.de:443 HTTP/1.1
Host: webapp-entw.mlp.de:443
User-Agent: git/1.9.5.msysgit.1
Proxy-Connection: Keep-Alive
Pragma: no-cache

< HTTP/1.1 503 Service Unavailable
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Proxy-Connection: close
< Connection: close
< Content-Length: 732
<
* Received HTTP code 503 from proxy after CONNECT
* Closing connection 0
fatal: unable to access 'https://Username@myWebService.de/randomGit.git/': Received HTTP code 503 from proxy after CONNECT

2 个答案:

答案 0 :(得分:2)

我有同样的错误代码。对我来说,症状是我可以成功地推送到远程仓库,但不会拉...在我的情况下,它似乎是一个名称解析问题。

首先,我发现这些设置可以更好地了解网络事件。

export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

通过这些设置,我收到了这样的痕迹:

PROMPT$ git pull
...
15:21:17.015575 run-command.c:351       trace: run_command: 'git-remote-https' 'origin' 'https://gitub.com/USERNAME/REPO'
* Couldn't find host gitub.com in the .netrc file; using defaults
* Hostname was NOT found in DNS cache
*   Trying PROXY-SERVER-IP-ADDRESS...
* Connected to (PROXY-SERVER-IP-ADDRESS) port 80 (#0)
* Establish HTTP proxy tunnel to gitub.com:443
> CONNECT gitub.com:443 HTTP/1.1
Host: gitub.com:443
User-Agent: git/2.3.2 (Apple Git-55)
Proxy-Connection: Keep-Alive
Pragma: no-cache

< HTTP/1.1 503 Service Unavailable
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Proxy-Connection: close
< Connection: close
< Content-Length: 787
< 
* Received HTTP code 503 from proxy after CONNECT
* Connection #0 to host PROXY-SERVER-IP-ADDRESS left intact
fatal: unable to access 'https://gitub.com/USERNAME/REPO/': Received HTTP code 503 from proxy after CONNECT

我对github.com,然后www.github.com做了一些ping,并发现了一些不同的结果。这促使我更新我的原始URL,如下所示。

git remote set-url origin https://www.github.com/USERNAME/REPO

只需添加“www。”在这种情况下,进入原始URL解决了我的连接问题。没有更多的503s - 推动和拉动都成功。

更新

根据您更新的跟踪,这看起来与我遇到的问题非常相似。您可能尝试的是临时替换您正在使用的存储库服务器的实际IP地址(而不是主机名)。如果可行,那么请查看名称解析的解决方案,例如修改/ etc / hosts。另外,您是否可以确认您尝试使用git remote set-url origin来包含完整的主机名而不仅仅是域名?

答案 1 :(得分:0)

我发现我的代理无法识别webapp地址,因此我安装了Privoxy并告诉他传递除了那些用于我的git的请求。它有效。

因此,如果我必须连接到存储库,我会跳过代理并直接连接。