Red Hat Satellite upgrade fails with a `PG::InsufficientPrivilege: ERROR: must be owner of extension evr` error
Environment
- Red Hat Satellite 6.16
Issue
- Failed to migrate to Satellite 6.17
Resolution
-
Perform the steps in the Diagnostic Steps section to verify that the reported issue is the same as the one resolved by this solution article. If the reported issue is not the same as the one described here, do not proceed with the resolution, and check Unable to Upgrade Red Hat Satellite 6.16 to 6.17 due to error 'PG::InsufficientPrivilege Error for Extension evr' to see if it addresses the reported issue.
-
Take a snapshot/backup of the Satellite server.
-
Run the following command on the Satellite server to manually drop the extension
evron the Satellite server:
# echo "drop extension evr cascade;" | su - postgres -c "psql foreman"
-
Retry the upgrade.
-
After the upgrade, verify the problematic migration has been successfully executed, otherwise errata applicability calculation will stop working. To verify, output of either command:
# su - postgres -c "psql foreman -c \"\d+ katello_rpms\"" | grep evr
# su - postgres -c "psql foreman -c \"\d+ katello_installed_packages\"" | grep evr
should print some output (see the other KCS for the output).
For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.
Root Cause
One of the DB migrations performed during the upgrade failed to execute the following statement:
DROP EXTENSION evr CASCADE;
and as a result, the upgrade failed.
Diagnostic Steps
-
The following error is loged in
/var/lib/pgsql/data/log/postgresql-DayOfTheWeek.log:2025-05-13 15:45:39 CEST LOG: starting PostgreSQL 13.20 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5), 64-bit 2025-05-13 15:45:39 CEST LOG: listening on IPv4 address "127.0.0.1", port 5432 2025-05-13 15:45:39 CEST LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2025-05-13 15:45:39 CEST LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2025-05-13 15:45:39 CEST LOG: database system was shut down at 2025-05-13 15:45:39 CEST 2025-05-13 15:45:39 CEST LOG: database system is ready to accept connections 2025-05-13 15:52:47 CEST LOG: unexpected EOF on client connection with an open transaction 2025-05-13 15:52:48 CEST LOG: received fast shutdown request 2025-05-13 15:52:48 CEST LOG: aborting any active transactions 2025-05-13 15:52:48 CEST LOG: background worker "logical replication launcher" (PID 4523) exited with exit code 1 2025-05-13 15:52:48 CEST LOG: shutting down 2025-05-13 15:52:48 CEST LOG: database system is shut down 2025-05-13 15:57:19 CEST LOG: starting PostgreSQL 13.20 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5), 64-bit 2025-05-13 15:57:19 CEST LOG: listening on IPv4 address "127.0.0.1", port 5432 2025-05-13 15:57:19 CEST LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2025-05-13 15:57:19 CEST LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2025-05-13 15:57:19 CEST LOG: database system was shut down at 2025-05-13 15:52:48 CEST 2025-05-13 15:57:19 CEST LOG: database system is ready to accept connections 2025-05-13 15:58:57 CEST ERROR: must be owner of extension evr 2025-05-13 15:58:57 CEST STATEMENT: DROP EXTENSION evr CASCADE; 2025-05-13 15:59:36 CEST ERROR: must be owner of extension evr 2025-05-13 15:59:36 CEST STATEMENT: DROP EXTENSION evr CASCADE; 2025-05-13 16:05:42 CEST ERROR: must be owner of extension evr 2025-05-13 16:05:42 CEST STATEMENT: DROP EXTENSION evr CASCADE; 2025-05-13 16:07:44 CEST ERROR: must be owner of extension evr 2025-05-13 16:07:44 CEST STATEMENT: DROP EXTENSION evr CASCADE; 2025-05-13 16:16:43 CEST ERROR: must be owner of extension evr 2025-05-13 16:16:43 CEST STATEMENT: DROP EXTENSION evr CASCADE; 2025-05-13 16:17:42 CEST LOG: duration: 503.676 ms statement: select count(*) from audits
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.