Skip to content

gitlab-pages on separate instance, cannot find workhorse socket

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Link the doc and describe what is wrong with it. https://docs.gitlab.com/ee/administration/pages/#running-gitlab-pages-on-a-separate-server

Following these instructions, I automated all the setup with NFS shares to publish pages to a specific separate server. using the predefined configuration:

external_url 'http://<ip-address-of-the-server>'
pages_external_url "http://<your-pages-server-URL>"
postgresql['enable'] = false
redis['enable'] = false
prometheus['enable'] = false
unicorn['enable'] = false
sidekiq['enable'] = false
gitlab_workhorse['enable'] = false
gitaly['enable'] = false
alertmanager['enable'] = false
node_exporter['enable'] = false
gitlab_rails['auto_migrate'] = false
# running in docker
gitlab_pages['inplace_chroot'] = true

result in a an unhealthy gitlab-pages service

f4f1536390ee        gitlab/gitlab-ce:latest   "/assets/wrapper"   2 hours ago         Up 18 minutes (unhealthy)

Analysing the logs I found out that the gitlab workhorse is still present in the generated nginx configuration, and it seems that it's dependent of the whole healthiness check.

==> /var/log/gitlab/nginx/gitlab_error.log <==
2020/02/08 19:27:53 [error] 255#0: *42 connect() to unix:/var/opt/gitlab/gitlab-workhorse/socket failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: code.devops, request: "GET /help HTTP/1.1", upstream: "http://unix:/var/opt/gitlab/gitlab-workhorse/socket:/help", host: "localhost"

This error log makes sense as we disabled the gitlab_workhorse in the configuration. Still there are a log of proxy_pass references to the workhorse in the generated nginx configuration:

cd nginx/conf && grep workhorse *
gitlab-health.conf:  return 500 'nginx returned $status when communicating with gitlab-workhorse\n';
gitlab-health.conf:  return 500 '{"error":"nginx returned $status when communicating with gitlab-workhorse","status":$status}\n';
gitlab-health.conf:  proxy_pass  http://gitlab-workhorse;
gitlab-health.conf:  proxy_pass  http://gitlab-workhorse;
gitlab-health.conf:  proxy_pass  http://gitlab-workhorse;
gitlab-http.conf:    proxy_pass http://gitlab-workhorse;
gitlab-http.conf:    proxy_pass  http://gitlab-workhorse;
gitlab-http.conf:    proxy_pass  http://gitlab-workhorse;
nginx-status.conf:      proxy_pass  http://gitlab-workhorse/-/metrics;
nginx.conf:  upstream gitlab-workhorse {
nginx.conf:    server unix:/var/opt/gitlab/gitlab-workhorse/socket;

Enabling the workhorse has other dependencies to redis and gitlab itself... What would be the correct configuration to uses a separate gitlab pages instance and still have an healthy system.

Kind regards

Edited by 🤖 GitLab Bot 🤖