全新安装的 GitLab 在主页上出现错误 500(Plesk,Debian 9)

全新安装的 GitLab 在主页上出现错误 500(Plesk,Debian 9)

我尝试在小型个人服务器上安装 GitLab,并对其进行配置,使其可以在 Plesk WebAdmin 子域上运行。我通过 Omnibus 包正常安装了 GitLab。我在 gitlab.rb 文件中更改了以下设置:

nginx['enable'] = false
web_server['external_users'] = ['www-data', 'PLESK_USER']
web_server['group'] = 'psacln'
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:8181"

其中 PLESK_USER 是链接到该 plesk 子域的用户。

我将子域上的 HTTP 重定向到 HTTPS,这有效,SSL 证书也有效。

在 Plesk 中的“HTTPS 的附加指令”下,我将此页面的文本粘贴到标签中<VirtualHost *:443>https://gitlab.com/gitlab-org/gitlab-recipes/blob/master/web-server/apache/gitlab-omnibus-ssl-apache24.conf

我将 YOUR_SERVER_FQDN 以及 3 行 SSLCertificateFile 替换为我在 /var/www/vhosts/system/fqdn/conf/last_nginx.conf 下找到的行

访问我的域名时,我立即收到 500 错误。这甚至在创建 root 用户之前就出现了。该消息似乎是 GitLab 特有的,带有 GitLab 徽标和相应的文本,因此我相信到 GitLab 本身的路由似乎正在运行。

在生产日志中,我每次访问站点仅获得以下输出:

Started GET "/-/metrics" for 127.0.0.1 at 2019-05-27 11:59:44 +0000
Processing by MetricsController#index as HTML
Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms)

并使用 gitlab-ctl tail

==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/-/metrics" for 127.0.0.1 at 2019-05-27 12:01:29 +0000
Processing by MetricsController#index as HTML
Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms)

==> /var/log/gitlab/gitlab-rails/production_json.log <==
{"method":"GET","path":"/-/metrics","format":"html","controller":"MetricsController","action":"index","status":200,"duration":2.64,"view":0.41,"db":0.0,"time":"2019-05-27T12:01:29.670Z","params":[],"remote_ip":null,"user_id":null,"username":null,"ua":null,"queue_duration":null,"correlation_id":"98970bd1-9618-41ea-85a2-5f59b26fd16b"}

对于我发出的每一个浏览器请求,这些消息都会立即显示一次。

sudo gitlab-rake gitlab:check --trace也没有透露任何进一步的缺失信息。缺乏任何具体的错误消息让我相信 Plesk 和 GitLab 之间的链接存在问题,而不是 GitLab 安装本身存在问题,但我在其他地方找不到这个具体的问题,我真的不知道该检查什么。

我很感激任何帮助。

编辑:检查 /var/log/gitlab/gitlab-workhorse/current 中的日志,在应用程序启动时(每次重新启动后)我可以看到以下错误消息

2019-05-27_13:11:49.39615 time="2019-05-27T13:11:49Z" level=error msg="unknown error" error="keywatcher: pubsub receive: EOF"
2019-05-27_13:11:49.39617 time="2019-05-27T13:11:49Z" level=info msg="redis: dialing" address=/var/opt/gitlab/redis/redis.socket network=unix
2019-05-27_13:11:49.39617 time="2019-05-27T13:11:49Z" level=error msg="unknown error" error="keywatcher: dial unix /var/opt/gitlab/redis/redis.socket: connect: no such file or directory"

但是,由于我没有更改最初提到的设置以外的任何设置,因此我实际上找不到与我的特定配置的任何联系。

答案1

我现在已经解决了这个问题。

在我的 Plesk 界面中,在“工具和设置”-“Apache Web 服务器”下未启用模块“proxy_http”。启用该模块可以完美地解决上述配置的问题!希望这可以帮助将来遇到同样问题的人。

相关内容