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 1985330 - Upgrade to Satellite 6.9 fails at db:migrate stage with 'could not create unique index "index_lookup_values_on_lookup_key_id_and_match"' error
Summary: Upgrade to Satellite 6.9 fails at db:migrate stage with 'could not create uni...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Upgrades
Version: 6.9.0
Hardware: All
OS: All
high
high
Target Milestone: 6.9.5
Assignee: Ondřej Ezr
QA Contact: Devendra Singh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-23 12:03 UTC by James Jeffers
Modified: 2024-06-14 01:36 UTC (History)
6 users (show)

Fixed In Version: foreman-2.3.1.23
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1960530
Environment:
Last Closed: 2021-08-31 12:04:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32673 0 High Closed Migrations fail with 'could not create unique index "index_lookup_values_on_lookup_key_id_and_match"' error 2021-07-23 12:04:06 UTC
Red Hat Knowledge Base (Solution) 6029911 0 None None None 2021-07-23 12:04:06 UTC
Red Hat Product Errata RHBA-2021:3387 0 None None None 2021-08-31 12:04:18 UTC

Comment 6 Devendra Singh 2021-08-12 07:26:37 UTC
Verified on 6.9.5 Snap2.

Verification steps:

1- Prepare the 6.8.z setup for the upgrade.
2- created a duplicate override record of one of the puppet smart class parameters inside lookup_values table

su - postgres -c 'psql foreman -c "SELECT * FROM lookup_values"'
 id  |                        match                        |                           value                            | lookup_key_id |         created_at         |         updated_at         | omit 
-----+-----------------------------------------------------+------------------------------------------------------------+---------------+----------------------------+----------------------------+------
...........
 178 | fqdn=1dockerpuppetclientrhel6                       | --- ahoj                                                  +|           208 | 2021-08-11 18:53:53.702347 | 2021-08-11 18:53:53.702347 | f
     |                                                     | ...                                                       +|               |                            |                            | 
     |                                                     |                                                            |               |                            |                            | 
 179 | fqdn=1dockerpuppetclientrhel6                       | --- ahoj2                                                 +|           208 | 2021-08-11 18:53:53.719496 | 2021-08-11 18:53:53.719496 | f
     |                                                     | ...                                                       +|               |                            |                            | 

.....................
     |                                                     |                                                            |               |                            |                            | 
(43 rows)

3- Ran the upgrade from 6.8.z to 6.9.5 Snap2.
# foreman-maintain upgrade run --target-version 6.9 -y
Checking for new version of satellite-maintain...
Nothing to update, can't find new version of satellite-maintain.
Running preparation steps required to run the next scenarios
================================================================================
Check whether system has any non Red Hat repositories (e.g.: EPEL) enabled: 
| Checking repositories enabled on the system                         [OK]      
--------------------------------------------------------------------------------

Running Checks before upgrading to Satellite 6.9
================================================================================
Clean old Kernel and initramfs files from tftp-boot:                  [OK]
--------------------------------------------------------------------------------
Check number of fact names in database:                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running:                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running using the ping call:           [OK]
--------------------------------------------------------------------------------
Check for paused tasks:                                               [OK]
--------------------------------------------------------------------------------
Check to verify no empty CA cert requests exist:                      [OK]
....................
...................
Running Migration scripts to Satellite 6.9
================================================================================
Setup repositories: 
| Configuring repositories for 6.9                                    [OK]      
--------------------------------------------------------------------------------
Unlock packages:                                                      [OK]
--------------------------------------------------------------------------------
Update package(s) :                                                   [OK]
--------------------------------------------------------------------------------
Procedures::Installer::Upgrade:                                       [OK]
--------------------------------------------------------------------------------
Execute upgrade:run rake task:                                        [OK]
--------------------------------------------------------------------------------

Running Procedures after migrating to Satellite 6.9
================================================================================
Start applicable services: 

Starting the following service(s):
rh-mongodb34-mongod, postgresql, qdrouterd, qpidd, rh-redis5-redis, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, smart_proxy_dynflow_core, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, puppetserver, dynflow-sidekiq@worker, dynflow-sidekiq@worker-hosts-queue, foreman-proxy
\ All services started                                                [OK]      
--------------------------------------------------------------------------------
re-enable sync plans: 
| Total 0 sync plans are now enabled.                                 [OK]      
--------------------------------------------------------------------------------
Remove maintenance_mode chain from iptables:                          [OK]
--------------------------------------------------------------------------------

Running Checks after upgrading to Satellite 6.9
================================================================================
Clean old Kernel and initramfs files from tftp-boot:                  [OK]
--------------------------------------------------------------------------------
Check number of fact names in database:                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running:                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running using the ping call:           [OK]
--------------------------------------------------------------------------------
Check for paused tasks:                                               [OK]
--------------------------------------------------------------------------------
Check to verify no empty CA cert requests exist:                      [OK]
--------------------------------------------------------------------------------
Check whether system is self-registered or not:                       [OK]
--------------------------------------------------------------------------------
Check if only installed assets are present on the system: 
- Checking for presence of non-original assets...                     [OK]      
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------
Upgrade finished.

4- Verified the fixed in version.

# rpm -qa|grep foreman-2.3.1.23
foreman-2.3.1.23-1.el7sat.noarch

# rpm -q satellite-6.9.5
satellite-6.9.5-1.el7sat.noarch

Comment 7 Devendra Singh 2021-08-12 07:38:56 UTC
Added one more post-upgrade verification point that was missed in BZ#1985330#c6

5- The duplicate entry was removed(that we added in step2 BZ#1985330#c6) from the puppet smart class parameters inside the lookup_values table after the upgrade.

# su - postgres -c 'psql foreman -c "SELECT * FROM lookup_values "
> '
 id  |                        match                        |                           value                            | lookup_key_id |         created_at         |         updated_at         | omit 
-----+-----------------------------------------------------+------------------------------------------------------------+---------------+----------------------------+----------------------------+------
............................
............................
............................
     |                                                     |                                                            |               |                            |                            | 
 179 | fqdn=1dockerpuppetclientrhel6                       | --- ahoj2                                                 +|           208 | 2021-08-11 18:53:53.719496 | 2021-08-11 18:53:53.719496 | f
     |                                                     | ...                                                       +|               |                            |                            | 
     |                                                     |                                                            |               |                            |                            | 
(42 rows)

Comment 12 errata-xmlrpc 2021-08-31 12:04:00 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 (Satellite 6.9.5 Async Bug Fix 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/RHBA-2021:3387


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