After booting my GitLab VM, I saw this error message when I tried to access its web interface:

502 Whoops, GitLab is taking too much time to respond

The first thing I did was to check if there was something weird going on by running top, but CPU load was basically at 0%, so I was confused.

Then I ran gitlab-ctl tail and saw this

/var/log/gitlab/unicorn/current
2016-12-10_17:49:03.34172 starting new unicorn master 2016-12-10_17:49:03.91477 master failed to start, check stderr log for details
2016-12-10_17:49:04.92438 failed to start a new unicorn master
2016-12-10_17:49:04.93238 starting new unicorn master
2016-12-10_17:49:08.01409 Received TERM from runit, sending to process group (-PID)
2016-12-10_17:49:08.10902 adopted existing unicorn master 11449
2016-12-10_17:53:41.88466 starting new unicorn master 2016-12-10_17:54:04.07763 adopted new unicorn master 2477
2016-12-10_18:12:39.19236 starting new unicorn master 2016-12-10_18:13:02.75378 adopted new unicorn master 2461

/var/log/gitlab/unicorn/unicorn_stderr.log
2016-12-10_18:12:12.13328 FATAL: terminating connection due to administrator command 2016-12-10_18:12:12.13328 FATAL: terminating connection due to administrator command 2016-12-10_18:12:12.13328 FATAL: terminating connection due to administrator command 2016-12-10_18:12:12.13328 LOG: shutting down 2016-12-10_18:12:12.13328 received TERM from runit, sending INT instead to force quit connections 2016-12-10_18:12:12.13329 LOG: received fast shutdown request 2016-12-10_18:12:12.15825 LOG: database system is shut down 2016-12-10_18:12:40.00150 LOG: database system was shut down at 2016-12-10 18:12:12 GMT 2016-12-10_18:12:40.15705 LOG: database system is ready to accept connections 2016-12-10_18:12:40.15719 LOG: autovacuum launcher started

Turns out, the GitLab service was not running at all, and this was confirmed by running a

gitlab-ctl status

The solution was then to just restart the service with

gitlab-ctl start

(as root) and GitLab was up and running again. After rebooting the VM again, the service went up again on its own, so I am still not sure what caused this the first time. The logs suggest that something sent a shutdown signal to GitLab, but they don’t say much more than that.

In conclusion, this 502 error message is a bit misleading. When you see it, you immediately think that GitLab is running and it is just timing out for some reason. However, should you stumble upon this error, make sure that GitLab is running after all, it might simply be down.