Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2161929 - Locale change caused by RHEL upgrade results in database index corruption "get() returned more than one Modulemd -- it returned 2!"
Summary: Locale change caused by RHEL upgrade results in database index corruption "ge...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.11.3
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: 6.11.5
Assignee: Evgeni Golov
QA Contact: Lukas Pramuk
URL:
Whiteboard:
: 2166744 2172655 2247864 (view as bug list)
Depends On: 2142270
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-18 10:59 UTC by Evgeni Golov
Modified: 2024-01-12 14:56 UTC (History)
23 users (show)

Fixed In Version: rubygem-foreman_maintain-1.0.19-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2142270
: 2166744 (view as bug list)
Environment:
Last Closed: 2023-03-07 19:00:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35966 0 Urgent New Locale change caused by RHEL upgrade results in database index corruption "get() returned more than one Modulemd -- it r... 2023-01-18 11:00:20 UTC
Red Hat Issue Tracker SAT-15632 0 None None None 2023-02-02 20:43:35 UTC
Red Hat Product Errata RHSA-2023:1151 0 None None None 2023-03-07 19:01:14 UTC

Description Evgeni Golov 2023-01-18 10:59:08 UTC
This is a clone for Foreman Maintain, as that needs to perform the reindexing in the case of a DB restore of a EL7 backup on EL8!


+++ This bug was initially created as a clone of Bug #2142270 +++

Description of problem:
----------------------

Repository synchronization on Red Hat Satellite 6.11.3 on RHEL-8 fails with the following error :

Katello::Errors::Pulp3Error "get() returned more than one Modulemd -- it returned 2!"




Error:
Katello::Errors::Pulp3Error
get() returned more than one Modulemd -- it returned 2!


It seems to be related to the locales change in glibc-2.28 causing the collation changed in Postgresql
--------------
https://dba.stackexchange.com/questions/268027/postgresql-duplicates-despite-having-a-unique-constraint
https://wiki.postgresql.org/wiki/Locale_data_changes
https://postgresql.verite.pro/blog/2018/08/27/glibc-upgrade.html
-------------


I checked 3 cases attached to this bugzilla. They are running Satellite on RHEL 8 which having glibc-2.28.

Looking at the pulp_created column in core_content, the duplicated records were also created after the release date of Satellite 6.11.

It seems like we will need to reindex all the tables to avoid the issue after upgrading the OS to RHEL 8.

Comment 1 Evgeni Golov 2023-01-18 11:00:19 UTC
Created redmine issue https://projects.theforeman.org/issues/35966 from this bug

Comment 2 Odilon Sousa 2023-02-08 15:00:36 UTC
*** Bug 2166744 has been marked as a duplicate of this bug. ***

Comment 4 Lukas Pramuk 2023-02-15 10:36:24 UTC
VERIFIED.

@Satellite 6.11.5 Snap 1
rubygem-foreman_maintain-1.0.19-1.el8sat.noarch

by the following manual reproducer:

1) Have el7 DB backup (6.11.z version)

2) Restore the backup to el8 machine using satellite-clone

# satellite-clone -y
...
 
PLAY RECAP *********************************************************************************************************
localhost                  : ok=75   changed=27   unreachable=0    failed=0    skipped=29   rescued=0    ignored=1  

3) Run DB re-index on el8 Satellite to detect DB corruption

FIX:
# runuser - postgres -c "reindexdb -a"
reindexdb: reindexing database "candlepin"
reindexdb: reindexing database "foreman"
reindexdb: reindexing database "postgres"
reindexdb: reindexing database "pulpcore"
reindexdb: reindexing database "template1"

vs.

REPRO:
# runuser - postgres -c "reindexdb -a"
reindexdb: reindexing database "candlepin"
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)=(sshrsakey, PuppetFactName) is duplicated.


>>> satellite-clone/satellite-maintain restores DB backup on RHEL8 w/o indices corruption

Comment 9 errata-xmlrpc 2023-03-07 19:00:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Critical: Satellite 6.11.5 Async Security Update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:1151

Comment 10 Ian Ballou 2023-04-10 21:00:44 UTC
*** Bug 2172655 has been marked as a duplicate of this bug. ***

Comment 11 Daniel Alley 2024-01-12 14:56:20 UTC
*** Bug 2247864 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.