Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-38395

Restoring Red Hat Satellite 6 is impossible when the backup contains db duplicate issues.

XMLWordPrintable

    • 13
    • False
    • rubygem-foreman_maintain-1.13.0
    • Critical
    • sat-rocket
    • Known Issue
    • Hide
      .Restoring from backup fails due to inconsistencies in the data

      If the backup is generated from a database with inconsistencies, the restore would fail.
      The `{foreman-maintain}` tool uses the PostgreSQL `amcheck` extension to detect inconsistencies in the data before backup to prevent issues during restore.

      Reach out to https://access.redhat.com/support/[Red{nbsp}Hat support] to fix any detected inconsistencies before proceeding with the backup.
      For more information, see https://access.redhat.com/solutions/7127707[Restoring Red Hat Satellite 6.16+ fails complaining about db duplicates on CREATE UNIQUE INDEX] in the _Red{nbsp}Hat Knowledgebase_.
      Show
      .Restoring from backup fails due to inconsistencies in the data If the backup is generated from a database with inconsistencies, the restore would fail. The `{foreman-maintain}` tool uses the PostgreSQL `amcheck` extension to detect inconsistencies in the data before backup to prevent issues during restore. Reach out to https://access.redhat.com/support/ [Red{nbsp}Hat support] to fix any detected inconsistencies before proceeding with the backup. For more information, see https://access.redhat.com/solutions/7127707 [Restoring Red Hat Satellite 6.16+ fails complaining about db duplicates on CREATE UNIQUE INDEX] in the _Red{nbsp}Hat Knowledgebase_.
    • Done
    • Manual
    • Yes

      While restoring backup customers may face issues similar to the ones mentioned below.

      Restoring foreman dump [FAIL]
      Failed executing runuser - postgres -c 'pg_restore -C -d postgres /transition/satellite-backup-2025-06-26-08-39-35/foreman.dump', exit status 1:
      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);

      Customers are facing this

      • While doing a daily/weekly backup/restore
      • Maintaining DR setups
      • When leapp upgrade is not possible [upgrade using backup/restore]. This causes a huge amount of delay in fixing the duplicates and re-doing the backup before restoration.
        This issue renders the backup useless and cannot be restored on any system and the whole satellite server might be not recoverable at all.

      The only way to detect this is to run db reindexing before backup.

      This happens because of postgres dumps. Previously it was tar/untar . https://issues.redhat.com/browse/SAT-24936 is probably where we switched to dump method and this problem came into effect.

      Possible fix ideas:

      • We may add some fix in foreman-maintain or atleast make the backup fail citing these kind of issues.

      Related KCS articles:
      https://access.redhat.com/solutions/6998041
      https://access.redhat.com/solutions/7053489
      https://access.redhat.com/solutions/7004750

              rh-ee-amolpati Amol Patil
              rhn-support-smajumdar Soham Majumdar
              Amol Patil Amol Patil
              Akshay Gadhave Akshay Gadhave
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: