fix: new installations via omnibus lock the file system

Context

While testing omnibus-gitlab!8202 (merged) we realized that the filesystem-in-use lockfile is set on registry startup for new installations, when the registry is enabled. Omnibus will enable the registry by default when using HTTPS https://docs.gitlab.com/administration/packages/container_registry/#enable-the-container-registry.

Problem

The following sequence of events fails:

  1. Install GitLab (fresh) via Omnibus
  2. Configure HTTPS
  3. sudo gitlab-ctl reconfigure
  4. The registry starts. The file docker/registry/lockfiles/filesystem-in-use is created.
  5. Enable the database manually
  6. The registry fails to start with the following error:
2025-02-27_18:35:07.40191 creating new registry instance: configuring application: registry filesystem metadata in use, please import data before enabling the database, see https://docs.gitlab.com/ee/administration/packages/container_registry_metadata_database.html#existing-registries
  1. Omnibus tries to start the registry failing in an infinite loop.

Solution

  • a) do not lock the file system until we are certain we have data
  • b) provide a mechanism to remove the lock file via Omnibus
  • c) do not use file system lock file at all and only use database-in-use

Workaround

The docker/registry/lockfiles/filesystem-in-use file can be deleted manually. Doing so will allow the registry to start and set the database-in-use file instead.

Edited by Jaime Martinez