2013-10-26 86 views
2

我刚刚建立了一个专用于GitLab的Ubuntu 64位服务器。GitLab和SSH/HTTP连接

我已经成功安装了GitLab,除了使用Git客户端(SmartGit)的SSH连接外,其他一切似乎都正常工作。

我点击 “克隆”,然后我插入SSH git的URL:

[email protected]:root/firstproject.git 

当我点击 “下一步”,它给了我这个错误:

Please check the repository URL. 

Could not read from remote repository.: /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'initialize': getaddrinfo: Name of service not know (SocketError) 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'open' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'block in connect' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'timeout' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'connect' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'do_start' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'start' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'get' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'allowed?' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'validate_access' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in 'exec' 
from /user/local/lib/ruby/2.0.0/net/http.rb:878:in '<main>' 
Please make sure you have the correct access rights and the repository exists. 

我曾尝试生成一个SSH密钥并将其放入/home/git/.ssh/config,但问题依然存在。
我甚至使用网页浏览器中的Gitlab控制面板将它添加为“键”。

我试图重新启动GitLab和SSH,但它没有帮助。 的HTTP方法可行,但给了我一个错误,如果我在同一时间commint &推很多文件:

The remote end hung up unexpectedly 
The remote end hun up unexpectedly 
RPC failed; result=22, HTTP code = 411 

Counting objects: 89, done 
Delta compression using up to 8 threads. 
Total 88 (delta 12), reused 0 (delta 0) 

我不需要解决这两个问题,我只需要完全具备其中之一加工。

+0

我增加了nginx.conf的max_file_size,现在HTTP方法起作用了。如果有人知道如何修复SSH方法,请在此处添加答案。 –

+0

您能否将错误的文本版本替换为图片?你可以谷歌文本,而不是图片。 – VonC

+0

新增文字版 –

回答

0

确保这不是配置问题,如报告issue 3324

sudo -u git -H vim /home/git/gitlab-shell/config.yml 

and change:

gitlab_url: http://yourhost to gitlab_url: http://yourhost/ 

Slash at the end is important.

+0

我已经拥有了。 –

2

从堆栈跟踪,它看起来像gitlab-shell无法解决DNS服务器自己的主机名来验证与库权限GitLab的web API。尝试登录到服务器并运行:

nslookup mydomain.test

其中“mydomain.test”是你在使用gitlab.ymlgitlab_url:设置的主机名。如果在输出中看到类似** server can't find mydomain.test的错误,这是您的问题。

如果是这样,你可以通过解决这个问题:

  1. 通过编辑/etc/resolv.conf,以便它可以正确地解析主机名纠正你的服务器的DNS配置。您需要添加的DNS服务器取决于您的托管环境;您必须与管理您的网络的人员进行沟通以找到适当的值。
  2. gitlab_url更改为使用http://localhost/而不是可外部路由的域名。
  3. 在您的服务器上为mydomain.test添加条目/etc/hosts,该条目指向127.0.0.1。
+0

服务器不能解析本地主机...我用腻子密钥生成器生成了一个新密钥,将公钥添加到服务器,在SmartGit中询问时加载私钥,现在它不会给出错误,但是继续询问ssh密钥... –

+0

好的我已经添加到我的DNS服务器的DNS规则指向Git服务器的IP,现在nslookup可以正确使用“mydomain.test”,但是当我尝试登录它时继续问我ssh密钥... –

+0

你被提示输入SSH密码的密码,或输入服务器的密码('[email protected]'s password:')?如果是SSH密码,则密码错误输入或密钥损坏;如果它是服务器的密码,可能是你的'〜git/.ssh/authorized_keys'文件存在问题。 –