7

我安装了 GitLab,一切似乎都很好。直到我通过运行再次检查应用程序状态:sudo -u git -H editor /home/git/gitlab-shell/config.yml. 这个项目是红色的,似乎有一个错误:

  gitlab-shell self-check failed
  Try fixing it:
  Make sure GitLab is running;
  Check the gitlab-shell configuration file:
  sudo -u git -H editor /home/git/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.

我尝试打开config.yml,但我似乎没有发现任何异常。你觉得我错过了什么?

另外,我有一个自定义 SSH 连接。从这个解释中我不明白的是:

Custom SSH Connection

If you are running SSH on a non-standard port, you must change the gitlab user's SSH config.

# Add to /home/git/.ssh/config
host localhost          # Give your setup a name (here: override localhost)
    user git            # Your remote git user
    port 2222           # Your port number
    hostname 127.0.0.1; # Your server name or IP
You also need to change the corresponding options (e.g. ssh_user, ssh_host, admin_uri) in the config\gitlab.yml file.

出于迷路,我没有这个/home/git/.ssh/config,我应该创建一个还是我只是缺少一些东西?

我的调用堆栈:

Checking Environment ...

Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.7.4 ? ... OK (1.7.6)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ... can't check, you have no projects
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: /usr/local/lib/ruby/2.0.0/net/http.rb:878:in `initialize': getaddrinfo: Name or service not known (SocketError)
        from /usr/local/lib/ruby/2.0.0/net/http.rb:878:in `open'
        from /usr/local/lib/ruby/2.0.0/net/http.rb:878:in `block in connect'
        from /usr/local/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
        from /usr/local/lib/ruby/2.0.0/net/http.rb:877:in `connect'
        from /usr/local/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
        from /usr/local/lib/ruby/2.0.0/net/http.rb:851:in `start'
        from /home/git/gitlab-shell/lib/gitlab_net.rb:62:in `get'
        from /home/git/gitlab-shell/lib/gitlab_net.rb:29:in `check'
        from /home/git/gitlab-shell/bin/check:11:in `<main>'
gitlab-shell self-check failed
  Try fixing it:
  Make sure GitLab is running;
  Check the gitlab-shell configuration file:
  sudo -u git -H editor /home/git/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ... can't check, you have no projects
Projects have satellites? ... can't check, you have no projects
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/local/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.4)

Checking GitLab ... Finished
4

4 回答 4

12

它可能类似于问题 5437

我在我的 debian wheezy 7.2 服务器上进行全新安装时遇到了完全相同的问题。

我做了两个更改并重新启动了服务器(没问题,因为它只是一个测试服务器):

  • 确保您的域指向(127.0.0.1/etc/hosts它指向的我的服务器上127.0.1.1
  • /home/git/.ssh/config为安装过程中提到的非标准 ssh 端口添加

在这种情况下,将域设置为127.0.0.1in/etc/hosts就足够了。

其他可能的问题:问题 5426:错误的 sidekick 命令

这种启动 sidekiq 的方式不再起作用。你必须使用:

sudo -u git -H RAILS_ENV=production script/background_jobs start

一个http.rb:xxx:in初始化': getaddrinfo: Name or service not known (SocketError)` 错误信息见于:

  • 问题 5151 =>由此评论解决:

    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.
    
  • gitlab-shell 的第 42 期:再一次,/etc/hosts正确的做法很重要。


OP Leandro Garcia在评论中证实:

我忘了设置我提供的域gitlab_url
添加它并更正我的域提供商上的 DNS 解决了这个问题

于 2013-11-08T12:36:55.907 回答
0

我刚刚升级到 7.2.2 并在 Ubuntu 14.04 LTS 下遇到了这个问题,之前从未看过 Ruby 代码。

在第 54 行附近查看 gitlab-shell/lib/gitlab_config.rb 我发现 redis['bin'] 的定义是空的,因此 gitlab-shell/bin/check 中的测试失败。

作为让它工作的快速技巧,我改变了:

# Build redis command to write update event in gitlab queue def redis_command if redis.empty? # Default to old method of connecting to redis # for users that haven't updated their configuration %W(env -i redis-cli) else if redis.has_key?("socket") %W(#{redis['bin']} -s #{redis['socket']}) else %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']}) end end end # Build redis command to write update event in gitlab queue def redis_command # Default to old method of connecting to redis # for users that haven't updated their configuration %W(env -i redis-cli) end

于 2014-09-20T16:05:01.010 回答
0

对我来说类似的东西,我的 Omnibus Gitlab 安装一切正常。我能够运行各种 GIT 更新和推送和拉取。

但是后来我更改了服务器的主机和域名配置,然后我的 gitlab 无法正确响应,出现与上述相同的错误。实际的主机名没有改变,但是该主机名/etc/hosts在我的 LAN 中和 LAN 上的表示方式。我认为我可以通过在我的本地~/.git/config文件中将 gitlab 服务器的位置设置为它的 IP 地址来解决这样的问题,但这还不够。我必须确保机器能够理解 Gitlab 自己的 NGINX 配置文件对其本地主机名的表示。

在标准的 Omnibus Gitlab 部署中,您的 nginx 配置文件位于此处:/var/opt/gitlab/nginx/etc/gitlab-http.conf,并且您对以下server部分感兴趣:

server { listen *:80; server_name hostname.on.your.domain;

一个快速测试是:你的 gitlab-http.conf 文件中配置的主机名是否可以 ping 通?

ping hostname.on.your.domain

如果没有,请仔细检查您的 /etc/hosts 和网络配置。

于 2014-06-18T06:10:38.250 回答
0

Had similar problem. I had wrong address in my gitlab-shell. 127.0.0.1:3000 was wrong, because I had to put the same address as I used via web (nginx proxy) for example gitlab.com.

于 2015-05-07T21:18:44.723 回答