GitLab Restore Fails with: must be able to SET ROLE "gitlab-psql"
Description
The restore cannot complete due to the following error:
-- Removing all tables. Press `Ctrl-C` within 5 seconds to abort
-- Cleaning the database ...
-- done
-- Restoring PostgreSQL database gitlabhq_production …
ERROR: must be able to SET ROLE "gitlab-psql"
Environment
Impacted offerings:
- GitLab Self-Managed
Impacted versions:
- 17.11
Solution
This is a known bug awaiting fix.
Workaround
Use the GITLAB_ASSUME_YES=1 environment variable to bypass this check carefully Example:
sudo -u git -H GITLAB_ASSUME_YES=1 bundle exec rake gitlab:backup:restore RAILS_ENV=production
Cause
Postgresql 16 introduced a new generally harmless error message that isn't matching our ignore pattern -- must be able to SET ROLE "gitlab-psql"
.