gitlab-ctl reconfigure fails in 13.1.x when unicorn is enabled

Summary

https://gitlab.zendesk.com/agent/tickets/161658

When running omnibus-gitlab, with puma['enable'] = false and unicorn['enable'] = true in the gitlab.rb, a gitlab-ctl reconfigure fails with an error message of

resource templatesymlink[Create a database.yml and create a symlink to Rails root] is configured to notify resource runit_service[unicorn] with action restart, but runit_service[unicorn] cannot be found in the resource collection. templatesymlink[Create a database.yml and create a symlink to Rails root] is defined in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb:175:in `from_file'`

Steps to reproduce

  1. Modify gitlab.rb to add the above parameters, enabling unicorn and disabling puma.
  2. Run a gitlab-ctl reconfigure and observe a successful restart of gitlab & related services
  3. Run another gitlab-ctl and observe the failure.

What is the current bug behavior?

gitlab-ctl reconfigure fails due to unicorn not being registered as a service at the time this particular step Create a database.yml and create a symlink to Rails root is executed.

What is the expected correct behavior?

WORKAROUND:

Stop the unicorn service before attempting a reconfigure, i.e.:

gitlab-ctl stop unicorn && gitlab-ctl reconfigure

Relevant logs

Details of package version

Reproduced on docker sha gitlab/gitlab-ee@sha256:5e1e9666617ccf19a55103d45215f6b073b183cd8c7b082cf66d928cd172ab33 running on docker 19.03.11, on CentOS 7.8

Environment details

Reproduced on docker sha gitlab/gitlab-ee@sha256:5e1e9666617ccf19a55103d45215f6b073b183cd8c7b082cf66d928cd172ab33 running on docker 19.03.11, on CentOS 7.8

Also reproduced in a standard omnibus install by @ehenley

Configuration details

$ sudo grep -v -e '^#' -e '^$' config/gitlab.rb

external_url 'https://my-domain'
unicorn['enable'] = true
puma['enable'] = false
letsencrypt['enable'] = true
letsencrypt['contact_emails'] = ["my-email"] # This should be an array of email addresses to add as contacts
Edited by 🤖 GitLab Bot 🤖