Database registry metadata with disabled SSL
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Can't disable SSL for database registry connection
Steps to reproduce
- Follow guide http://instance-url/help/administration/packages/container_registry_metadata_database.md
- Copy paste registry database
- Change sslmode to disable https://www.postgresql.org/docs/current/libpq-ssl.html
- Run migrate schema up
- Gitlab fail migrating because looking for SSL file (key, cert)
What is the current bug behavior?
Gitlab looking for SSL key, file that doesn't exist.
Expected result
Migration run without care of SSL key, cert file due SSL mode 'disable'
Results of GitLab environment info
Self Managed gitlab 17.7.0
Log
root@gitlab-homelab:/# gitlab-ctl registry-database migrate up
Running migrate up
WARNING: Command cannot run while the container registry is running. Stop the registry before proceeding? (y/n)
y
Stopping service registry
ok: down: registry: 1s, normally up
Executing command:
/opt/gitlab/embedded/bin/registry database migrate up /var/opt/gitlab/registry/config.yml
failed to construct database connection: parsing connection string failed: cannot parse `host=db-registry port=5432 user=gitlab password=xxxxx dbname=dbreg sslmode=disable sslcert=/path/to/cert.pem sslkey=/path/to/private.key sslrootcert=/path/to/ca.pem`: failed to configure TLS (unable to read CA file: open /path/to/ca.pem: no such file or directory)
Edited by 🤖 GitLab Bot 🤖