Reindexing of foreman database fails with error`could not create unique index "index_fact_names_on_name_and_type"`after the in-place OS upgrade of Satellite 6.11 to RHEL 8

Solution Verified - Updated -

Issue

  • After performing the in-place OS upgrade of the Red Hat Satellite 6.11 server from RHEL 7 to 8, the attempt of reindexing all the databases as per the upgrade guide, runs into one or both of the following errors:

    reindexdb: reindexing database "foreman" 
    reindexdb: error: reindexing of database "foreman" failed: ERROR:  could not create unique index "index_fact_names_on_name_and_type"
    DETAIL:  Key (name, type)=(augeasversion, PuppetFactName) is duplicated.   
    
    reindexdb: reindexing database "foreman"
    reindexdb: error: reindexing of database "foreman" failed: ERROR:  could not create unique index "index_fact_names_on_name_and_type"
    DETAIL:  Key (name, type)=(memory::swaptotal, Katello::RhsmFactName) is duplicated.
    
    reindexdb: reindexing database "foreman"
    reindexdb: error: reindexing of database "foreman" failed: ERROR:  could not create unique index "index_fact_names_on_name_and_type"
    DETAIL:  Key (name, type)=(ansible_python::version, ForemanAnsible::FactName) is duplicated.
    
    reindexdb: reindexing database "foreman"
    reindexdb: error: reindexing of database "foreman" failed: ERROR:  could not create unique index "index_fact_names_on_name_and_type"
    DETAIL:  Key (name, type)=(processorcount, DiscoveryFactName) is duplicated.
    
    reindexdb: reindexing database "foreman"
    reindexdb: error: reindexing of database "foreman" failed: ERROR: could not create unique index "katello_available_module_streams_name_stream_context".
    DETAIL: key (name, stream, context)=(pmdk, 1-fileformat-v6, b4937e53) is duplicated.
    
  • The problem could also occur during the migration of the whole satellite instance to a new RHEL 8 system.

Environment

  • Red Hat Satellite 6.11

    • Being converted from RHEL 7 to RHEL 8 or being migrated to RHEL 8.

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content