Container Registry Maintenance instructions do not work

Problem to solve

The Gitlab documentation at https://docs.gitlab.com/omnibus/maintenance/README.html#container-registry-garbage-collection details two methods of garbage collection for the Container Registry feature.

Both these methods fail with a similar error on our Gitlab 11.9.4-ee Omnibus installation from Debian package:

$ sudo gitlab-ctl registry-garbage-collect
ok: down: registry: 0s, normally up, want up
Running garbage-collect using configuration from /var/opt/gitlab/registry/config.yml, this might take a while...
configuration error: error parsing /var/opt/gitlab/registry/config.yml: No storage configuration provided

Usage: 
  registry garbage-collect <config> [flags]
Flags:
  -m, --delete-untagged=false: delete manifests that are not currently referenced via tag
  -d, --dry-run=false: do everything except remove the blobs
  -h, --help=false: help for garbage-collect

Additional help topics:

Failed to run garbage-collect command, starting registry service.
timeout: down: registry: 31s, normally up

And:

$ sudo /opt/gitlab/embedded/bin/registry garbage-collect /var/opt/gitlab/registry/config.yml
configuration error: error parsing /var/opt/gitlab/registry/config.yml: No storage configuration provided

Usage: 
  registry garbage-collect <config> [flags]
Flags:
  -m, --delete-untagged=false: delete manifests that are not currently referenced via tag
  -d, --dry-run=false: do everything except remove the blobs
  -h, --help=false: help for garbage-collect

Further details

The gitlab-ctl reconfigure stage for the no-downtime method adds the following line to /var/opt/gitlab/registry/config.yml which looks more like JSON than YAML:

storage: {"maintenance":{"readonly":{"enabled":true}},"cache":{"blobdescriptor":"inmemory"},"delete":{"enabled":true}}

However, reformatting this as YAML does not seem to help with the error.

Assignee Loading
Time tracking Loading