Restoring Red Hat Satellite 6.16 or 6.17 fails complaining about db duplicates on CREATE UNIQUE INDEX
Environment
- Red Hat Satellite
- 6.16
- 6.17
Issue
-
Restoring Satellite 6.16 (or 6.17) fails with:
pg_restore: while PROCESSING TOC: pg_restore: from TOC entry 4967; 1259 20295 INDEX index_fact_names_on_name_and_type foreman pg_restore: error: could not execute query: ERROR: could not create unique index "index_fact_names_on_name_and_type" DETAIL: Key (name, type)=(lscpu_flags, Katello::RhsmFactName) is duplicated. Command was: CREATE UNIQUE INDEX index_fact_names_on_name_and_type ON public.fact_names USING btree (name, type); pg_restore: from TOC entry 5507; 1259 3233544 INDEX index_katello_installed_packages_on_nvrea foreman pg_restore: error: could not execute query: ERROR: could not create unique index "index_katello_installed_packages_on_nvrea" DETAIL: Key (nvrea)=(gcc-objc++-4.8.5-44.el7.x86_64) is duplicated. Command was: CREATE UNIQUE INDEX index_katello_installed_packages_on_nvrea ON public.katello_installed_packages USING btree (nvrea); pg_restore: from TOC entry 5637; 1259 4054876 INDEX katello_available_module_streams_name_stream_context foreman pg_restore: error: could not execute query: ERROR: could not create unique index "katello_available_module_streams_name_stream_context" DETAIL: Key (name, stream, context)=(pmdk, 1_fileformat_v6, d63f516d) is duplicated. Command was: CREATE UNIQUE INDEX katello_available_module_streams_name_stream_context ON public.katello_available_module_streams USING btree (name, stream, context);
Resolution
This issue has been addressed by This content is not included.Restoring Red Hat Satellite 6 is impossible when the backup contains db duplicate issues, which has been implemented in Red Hat Satellite 6.18 based on RHSA-2025:19721 - Security Advisory.
For more KB articles/solutions related to Red Hat Satellite 6.x backup issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x backup-related Issues
Root Cause
Starting with Red Hat Satellite 6.16, backup of the Satellite databases is performed via PostgreSQL dumps. If duplicates are present in the Satellite databases dumps, restoration will fail on CREATE UNIQUE INDEX complaining about DB duplicates.
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.