git GitLab HTTP URL 上的 504 网关超时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18501296/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:58:23  来源:igfitidea点击:

504 gateway timeout on GitLab HTTP URLs

gitnginxgitlabgit-guiatlassian-sourcetree

提问by Nicholas Albion

I have installed GitLab 6.0 on a linux box and created a number of projects. I can create a local clone of each project using the SSH URL, but when I try to use the HTTP URL I get a 504 Gateway Timeout within seconds.

我已经在 linux 机器上安装了 GitLab 6.0 并创建了许多项目。我可以使用 SSH URL 创建每个项目的本地克隆,但是当我尝试使用 HTTP URL 时,我在几秒钟内收到504 Gateway Timeout

  • When I paste the HTTP URL into SourceTree it says "Checking source" for a second or so, then "This is not a valid source path / URL". When I click on "Details..." it says:
  • 当我将 HTTP URL 粘贴到 SourceTree 时,它​​会显示“检查源”一秒钟左右,然后“这不是有效的源路径/URL”。当我点击“详细信息...”时,它说:
The requested URL returned error: 504 while accessing http://myserver/group/project.git/info/refs
请求的 URL 在访问 http://myserver/group/project.git/info/refs 时返回错误:504
  • Git Gui also attempts to access the http ://myserver/group/project.git/info/refs URL and gets a 504 error.

  • When I attempt to open this "info/refs" URL in a browser I get a "Authentication Required" popup which ** does not accept** my GitLab username/password nor email/password.

  • The Eclise EGit plugin has fields to provide a username & password - if I fill those out then I get a list of branches, but then I get a "Read timed out" on the clone operation (the repo is 2GB). This approach does work on smaller projectson my GitLab server.

  • Git Gui 还尝试访问 http://myserver/group/project.git/info/refs URL 并收到 504 错误。

  • 当我尝试在浏览器中打开这个“信息/参考”URL 时,我收到一个“需要身份验证”的弹出窗口,其中 ** 不接受**我的 GitLab 用户名/密码和电子邮件/密码。

  • Eclise EGit 插件有提供用户名和密码的字段 - 如果我填写这些字段,然后我会得到一个分支列表,但是我会在克隆操作中得到一个“读取超时”(repo 是 2GB)。这种方法确实适用于我的 GitLab 服务器上的较小项目

As per the instructions, I've used nginx, but it seems to be the source of a number of problems that I'm having.

按照说明,我使用了 nginx,但它似乎是我遇到的许多问题的根源。

sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production:

sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

System information
System:         Ubuntu 12.04
Current User:   git
Using RVM:      yes
RVM Version:    1.6.9
Ruby Version:   1.9.3p0
Gem Version:    1.8.11
Bundler Version:1.3.5
Rake Version:   10.1.0

GitLab information
Version:        6.0.0
Revision:       5246d63
Directory:      /home/git/gitlab
DB Adapter:     mysql2
URL:            http://myserver
HTTP Clone URL: http://myserver/some-project.git
SSH Clone URL:  git@myserver:some-project.git
Using LDAP:     no
Using Omniauth: no

GitLab Shell
Version:        1.7.0
Repositories:   /home/git/repositories/
Hooks:          /home/git/gitlab-shell/hooks/
Git:            /usr/bin/git

回答by Pedro Madrid

This usually is a proxy server issue. Just open a terminal and run this command to bypass the proxy for the remote. (assuming your remote server is called "origin"):

这通常是代理服务器问题。只需打开一个终端并运行此命令即可绕过远程代理。(假设您的远程服务器称为“来源”):

git config --add remote.origin.proxy ""

More info here: Git proxy bypass

更多信息:Git 代理绕过