Database backup restore `ERROR: must be owner of extension`
Description
While performing a database restore from a backup you may see:
ERROR: must be owner of extension pg_trgm ERROR: must be owner of extension btree_gist ERROR: must be owner of extension plpgsql WARNING: no privileges could be revoked for "public" (two occurrences) WARNING: no privileges were granted for "public" (two occurrences)
Environment
Impacted offerings:
- GitLab Self-Managed
- Omnibus Linux Packages
Solution
These errors should not prevent the backup from being restored. You can confirm the health of the database following the commands listed in the Restore for Linux package installations section of the GitLab documentation.
Cause
The gitlab-backup restore
task runs as the gitlab
user, which doesn’t have superuser access to the database. When restore is initiated, it runs as the gitlab
user and tries to alter the objects it doesn’t have access to. Those objects have no influence on the database backup or restore, but display a warning message.
Related Links
Docs: Restoring database backup using output warnings from a Linux package installation