双重检查GitLab安装:gitlab-shell自检失败

时间:2013-11-08 12:33:40

标签: git gitlab

我安装了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 个答案:

答案 0 :(得分:11)

它可能类似于Issue 5437

  

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

     

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

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

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

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

  

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

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

http.rb:xxx:in初始化':getaddrinfo:名称或服务未知(SocketError)`错误消息见:

  • Issue 5151 =&gt;由this comment解决:

    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.
    
  • Issue 42 of gitlab-shell/etc/hosts再一次非常重要。


OP Leandro Garcia确认in the comments

  

我忘了设置我在gitlab_url 上提供的域名   在我的域名提供商上添加并更正DNS可以解决问题

答案 1 :(得分:0)

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

但后来我改变了服务器的主机和域名配置,然后我的gitlab没有正确响应,给出了与上面相同的错误。实际的主机名没有改变,但是在/etc/hosts和我的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和网络配置。

答案 2 :(得分:0)

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

查看第54行的gitlab-shell / lib / gitlab_config.rb,我发现redis [&#39; bin&#39;]的定义是空的,因此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

答案 3 :(得分:0)

有类似的问题。 我的gitlab-shell中的地址错误。 127.0.0.1:3000错了,因为我必须使用与web(nginx代理)相同的地址,例如gitlab.com。