首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GitLab和SSH/HTTP连接

GitLab和SSH/HTTP连接
EN

Stack Overflow用户
提问于 2013-10-26 10:39:34
回答 2查看 11.2K关注 0票数 3

我刚刚设置了一个专门用于GitLab的Ubuntu64bit服务器。

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

单击"Clone",然后插入ssh git URL:

代码语言:javascript
复制
git@mydomain.test:root/firstproject.git

当我单击"Next“时,它会给出以下错误:

代码语言:javascript
复制
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控制面板将其添加为"key“。

我尝试过重新启动GitLab和SSH,但是没有帮助。HTTP方法可以工作,但如果同时使用commint&push多个文件,则会给出一个错误:

代码语言:javascript
复制
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)

我不需要解决这两个问题,我只需要让其中一个充分发挥作用。

EN

回答 2

Stack Overflow用户

发布于 2013-10-27 02:22:48

从堆栈跟踪来看,gitlab-shell似乎无法用GitLab的web解析服务器自己的主机名来验证存储库的权限。尝试登录到服务器并运行:

nslookup mydomain.test

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

如果是这样的话,您可以通过以下两种方法来解决这个问题:

  1. 通过编辑/etc/conv.conf来纠正服务器的DNS配置,这样它就可以正确地解析主机名。您需要添加的DNS服务器取决于您的托管环境;您必须与管理您的网络的人交谈,以找到合适的值。
  2. gitlab_url更改为使用http://localhost/而不是外部可路由的域名。
  3. 在服务器上为/etc/主机添加一个指向127.0.0.1的条目。
票数 2
EN

Stack Overflow用户

发布于 2013-10-26 11:33:00

确保这不是配置问题,正如第3324期中所报告的那样

sudo -u git -H vim /home/git/gitlab/config.yml 和改变: gitlab_url:http://yourhost to gitlab_url:http://yourhost/ 最后的斜杠是很重要的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19605691

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档