"GitLab is not responding." 502 on Ubuntu 14.04 启动服务器后

"GitLab is not responding." 502 on Ubuntu 14.04 after starting server

我刚刚在新 Ubuntu 14.04 64 位服务器上安装了 GitLab。我使用 download page 中指示的 Omnibus 包来完成此操作。安装过程中没有错误消息,脚本中的所有注释都显示为绿色。

当我通过端口 80 访问服务器时,我得到以下信息:

下面Trouble Shooting Guide我尝试查询状态,结果也是报错:

sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
sudo: bundle: command not found

我尝试访问日志,但系统中找不到 unicorn.stderr.log 文件。

在Ubuntu12.04上有a similar question同样的错误,解决方法是增加unicorn超时时间。我已尝试这样做,但错误消息仍然存在。

从 gitlab started/restarted 到它真正能够处理请求的时间点有大约 5 分钟的延迟。这是日志中的示例:

2015-01-08_09:00:57.37719 [13326] 08 Jan 10:00:57.377 * The server is now ready to accept connections on port 0
2015-01-08_09:00:57.37722 [13326] 08 Jan 10:00:57.377 * The server is now ready to accept connections at /var/opt/gitlab/redis/redis.socket

[...]

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
I, [2015-01-08T10:04:48.676879 #13351]  INFO -- : listening on addr=127.0.0.1:8080 fd=11
I, [2015-01-08T10:04:48.677663 #13351]  INFO -- : unlinking existing socket=/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket
I, [2015-01-08T10:04:48.690283 #13351]  INFO -- : listening on addr=/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket fd=12
I, [2015-01-08T10:04:48.716769 #13413]  INFO -- : worker=0 spawned pid=13413
I, [2015-01-08T10:04:48.735878 #13351]  INFO -- : master process ready
I, [2015-01-08T10:04:48.846635 #13416]  INFO -- : worker=1 spawned pid=13416
I, [2015-01-08T10:04:48.837438 #13413]  INFO -- : worker=0 ready
I, [2015-01-08T10:04:48.863110 #13416]  INFO -- : worker=1 ready

在 Unicorn 报告它已启动并且 运行 在端口 8080 上之前,将显示 "GitLab is not responding" 消息。所以大家只需要等待即可。

我在2018年底的CentOS 7.5 64位服务器上安装GitLab EE遇到了类似的问题

您必须注意的最重要的事情是确保您的服务器处于最低性能要求!

In the official documentation of GitLab,您的服务器必须至少有 2 个内核和 8GB 内存。

如果你的服务器小于2核8GBRAM.You可以尝试做一个Swap来获得更多的内存,然后重新配置并重启你的GitLab.If你还是有这种情况,所以要注意Gitlab第一次启动的另一个大而可怕的问题:

安装GitLab后可能需要很长时间才能加载第一页,如上述答案所述!

Note:If you have a server with lower performance such as: 1 core & 1GB RAM,it will be 502 at most time,even if you try to make the Swap to 8GB RAM,it's not working,the only way you can do is to make the performance of the server more than 2 cores & 8GB RAM minimum.

其他一些方法可以让您找到更详细有用的信息:

  • 我们可以使用gitlab-ctl tail获取详细信息,然后复制日志,找到warning,failed等关键字。

  • 你可以去/var/log/gitlab的子目录下找日志获取一些信息

如果它显示 502 bad gateway,请尝试 运行 从您的 gitlab 服务器执行以下命令。

sudo service gitlab-runsvdir start

如果遇到504,请从AWS/GCP重启服务器。