After update to 18.6 registry with metadata database breaks "registry filesystem metadata in use, please import data before enabling the database"

There is a workaround available that addresses the lockfile inconsistency issue you're experiencing. Please follow the instructions here: container-registry#1776 (closed)


I migrated my registry to the metadata base on version 18.5 by following these steps:

  1. Disable metadata in config via
registry['database'] = {
  'enabled' => false,
}
  1. Create the database via
sudo -u registry gitlab-ctl registry-database migrate up
  1. Import the data
sudo -u registry gitlab-ctl registry-database import --log-to-stdout
  1. Enable the metadata db via
registry['database'] = {
  'enabled' => true,
}

In my configuration I don't have the registry['storage'] = {... block since I am using the local file-system which is configured via gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry". This also worked fine, and the new registry was working as expected. However after the update to GitLab 18.6 the registry now does not start anymore with the error registry filesystem metadata in use, please import data before enabling the database. I also tried to reimport the data with the same import command, but this returns an error, that the tags already exist in the database.

I assume this is because some old metadata files are still on the filesystem that where not fully deleted during the import?

Edited by Jaime Martinez