skip to Main Content

The /var/opt/gitlab/gitlab-workhorse/ folder is missing a socket and is generally almost empty.

I’m trying to set up GitLab + nginx proxy. When I try to load the page, I get a 502 error.
Having figured out what exactly does not work for me, I realized (gitlab-ctl status):

down: gitlab-workhorse: 0s, normally up, want up; run: log: (pid 3756258) 12450s

Then I decided to look at my workhorse socket and this is what I saw in the /var/opt/gitlab/gitlab-workhorse folder (ls -ap /var/opt/gitlab/gitlab-workhorse/):

./ ../ config.toml VERSION

My gitlab settings:

nginx['enable'] = false
web_server['external_users'] = ['www-data']
gitlab_rails['trusted_proxies'] = ['127.0.0.1', <external-server-ip>]
gitlab_workhorse['listen_network'] = "unix"
gitlab_workhorse['listen_addr'] = "/var/opt/gitlab/gitlab-workhorse/sockets/socket"

nginx log:

connect() to unix:/var/opt/gitlab/gitlab-workhorse/sockets/socket failed (13: Permission denied) while connecting to upstream

As I understand it, I am missing the required software or some files. Where can I get them if that’s the problem. If not, why might my workhorse not work?

p.s. sorry for google translate 🙂

upd. (/var/log/gitlab/gitlab-workhorse/current):

{"build_time":"20221024.191252","level":"info","msg":"Starting","time":"2022-10-30T20:05:21+03:00","version":"v15.5.1"}
{"address":"localhost:9229","level":"info","msg":"Running metrics server","network":"tcp","time":"2022-10-30T20:05:21+03:00"}
{"level":"info","msg":"keywatcher: starting process loop","time":"2022-10-30T20:05:21+03:00"}
{"address":"/var/opt/gitlab/redis/redis.socket","level":"info","msg":"redis: dialing","network":"unix","time":"2022-10-30T20:05:21+03:00"}
{"address":"/var/opt/gitlab/gitlab-workhorse/sockets/socket","level":"info","msg":"Running upstream server","network":"unix","time":"2022-10-30T20:05:21+03:00"}
{"error":"listen unix /var/opt/gitlab/gitlab-workhorse/sockets/socket: bind: no such file or directory","level":"fatal","msg":"shutting down","time":"2022-10-30T20:05:21+03:00"

2

Answers


  1. Change path to socket in listen_addr setting to existing directory.

    For example gitlab_workhorse['listen_addr'] = "/var/opt/gitlab/gitlab-workhorse/socket" or gitlab_workhorse['listen_addr'] = "/tmp/gitlab-workhorse-socket"

    Login or Signup to reply.
  2. For me, I had upgraded to 15.5, and saw this in the nginx error log:

    connect() to unix:/var/opt/gitlab/gitlab-workhorse/socket failed (2: No such file or directory) while connecting to upstream

    Looks like the gitlab folks changed the path of that socket file from /var/opt/gitlab/gitlab-workhorse/socket to /var/opt/gitlab/gitlab-workhorse/sockets/socket.

    Change the path in /etc/nginx/sites-available/gitlab and then run nginx -s reload && systemctl restart nginx (OR change the path like previously suggested in gitlab.rb and run gitlab-ctl reconfigure.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search