0

I'm currently trying self-host a gitlab server. For this I'm following along the documentation [here]. What happens is that the installation process gets stuck in a loop, continuously repeating very similar log messages.

What I did:

I have the command

sudo docker run --detach \
  --hostname gitlab.MY-URL.net \
  --publish 28043:443 --publish 28080:80 --publish 28022:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab \
  --volume $GITLAB_HOME/logs:/var/log/gitlab \
  --volume $GITLAB_HOME/data:/var/opt/gitlab \
  --shm-size 256m \
  gitlab/gitlab-ee:latest

in a bash file and run it. I use the command

sudo docker logs -f gitlab | tee gitlab.log

to observe the progress

It appears to progress flawlessly at first, but then the errors begin and the progress gets stuck in a loop of seemingly repeating errors, possible continuously failing and retrying.

Errors that don't repeat

DSN

==> /var/log/gitlab/gitlab-rails/production.log <==
Raven 3.1.2 configured not to capture errors: DSN not set
... # repeated, 5 times in total

I'm not familiar with the technology stack underlying gitlab, but this appears to be for things like automatic mail delivery. While I want to have this eventually, it's not the pressing issue right now.

dial unix / gitlab.socket

==> /var/log/gitlab/gitlab-workhorse/current <==
{"correlation_id":"","duration_ms":0,"error":"badgateway: failed to receive response: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory","level":"error","method":"GET","msg":"","time":"2023-08-22T13:54:01Z","uri":""}

This error is logged twice in succession. Using ls inside the running (and looping) container shows the following:

root@gitlab:/# ls /var/opt/gitlab/gitlab-rails/sockets/ -l
total 0
srwxrwxrwx 1 git git 0 Aug 22 14:43 gitlab.socket

So gitlab.socket exists where it is expected, but it is not a file. Which confuses me as to why the gitlab installation process apparently tries to open it like a file.

gitaly

==> /var/log/gitlab/gitaly/current <==
{"level":"info","msg":"Upgrade succeeded","time":"2023-08-22T13:54:23.196Z"}
{"error":"graceful upgrade: completed","level":"error","msg":"Gitaly shutdown","time":"2023-08-22T13:54:23.213Z"}

postgress config

2023-08-22_13:54:30.75614 ts=2023-08-22T13:54:30.756Z caller=main.go:86 level=warn msg="Error loading config" err="Error opening config file \"postgres_exporter.yml\": open postgres_exporter.yml: no such file or directory"

I can't confirm whether or not this file is there, as the path appears to be relative.

discovery manager / service discovery

2023-08-22_13:54:28.58747 ts=2023-08-22T13:54:28.587Z caller=manager.go:317 level=error component="discovery manager scrape" msg="Cannot create service discovery" err="unable to load specified CA cert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory" type=kubernetes config=kubernetes-nodes

Using ls again shows that there is only a /var/run/ folder, but the rest of the path does not exist. I don't know what gitlab was trying here. I do not utilize kubernetes (at least no explicitly?)

The error message repeats almost identical, only the parameter type= at the end varies a bit between kubernetes-nodes, kubernetes-pods etc.

Repeating Error

collector

2023-08-22_13:53:48.88658 ts=2023-08-22T13:53:48.886Z caller=collector.go:190 level=error msg="collector failed" name=replication duration_seconds=0.228480569 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2023-08-22 13:50:44.701812 +0000 GMT\") to a float64: invalid syntax"

My guess would be that it reads some sort of None or empty string, which of course can't be parsed into a number.

Notes

Some additional notes for more context.

  • The environment variable GITLAB_HOME is defined as /srv/gitlab

  • MY-URL.net and gitlab.MY-URL.net resolve to a private server, proxied via cloudflare. The needed dns records are created and up-to-date

  • Regarding the port remapping:

    • The same server machine is also hosting a regulare website (behind MY-URL.net). It is further running cloudflared to enable SSH tunneling. If I don't remap the SSH port, cloudflared and gitlab will collide and the gitlab setup aborts with a matching error message.

    • I hope to eventually access the gitlab website via the url gitlab.MY-URL.net:28080 (and eventually :28043 once I setup HTTPS)

    • The ports are open on the router via a port range (28000-28255) for TCP traffic

  • Before each retry, the created container gitlab and the folder /srv/gitlab are removed.

  • I'm not running a mail server right now, and I hope I don't have to and can just use 'private' mail addresses from a regular provider

  • This is for a private project (as of now). But I would like to have the possibility to have the project grow to include more people.

Edit

I retried it, this time with minimal port remapping. I deactivated the apache server and the cloudflared service, but it seems that the container was still being blocked by some other process on port 22. The only process that used that port was ssh that I used to connect to the server in the first place. Any way, the error persists and when trying to access gitlab.MY-URL.net, the default cloudlfare page is shown and states that the server is not responding.

I'm at a loss here. A while back I was able to setup gitlab by installing it directly on a server. But now using docker, which promises to simplify the installation process, I'm unable to do it.

melon_maniac
  • 123
  • 4

0 Answers0