-
Bug
-
Resolution: Done-Errata
-
Blocker
-
6.17.0
-
3
-
False
-
rubygem-katello-4.16.0.7
-
Important
-
Phoenix Sprint 152
-
sat-artemis
-
None
-
None
-
None
-
No Coverage
-
Yes
Description of problem:
While upgrading the Satellite from 6.16 to 6.17, the upgrade is failing with the following error:
~~~
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_katello_installed_packages_on_nvrea"
~~~
Following is the detailed trace of the same from the satellite.log file:
==================================
- 2025-05-15 14:15:02 [DEBUG ] [configure] Exec[foreman-rake-db:migrate](provider=posix): Executing '/usr/sbin/foreman-rake db:migrate'
- 2025-05-15 14:15:02 [DEBUG ] [configure] Executing with uid=foreman: '/usr/sbin/foreman-rake db:migrate'
- 2025-05-15 14:16:12 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: rake aborted!
- 2025-05-15 14:16:12 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db: migrate]/Exec[foreman-rake-db:migrate]/returns: StandardError: An error has occurred, this and all later migrations canceled:
- 2025-05-15 14:16:12 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns:
- 2025-05-15 14:16:12 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_katello_installed_packages_on_nvrea"
- 2025-05-15 14:16:12 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: DETAIL: Key (nvrea)=(gcc-objc++-4.8.5-39.el7.x86_64) already exists.
- 2025-05-15 14:16:12 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /usr/share/gems/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in `exec'
- 2025-05-15 14:16:12 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /usr/share/gems/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in `block (2 levels) in execute'
==================================
For detailed logs, please check the attached 'satellite-upgrade-db-migrate.log' file.
Steps to reproduce:
1. Enable the satellite-maintain 6.17 repo by referring to the KCS and upgrade the maintenance package.
2. After running the upgrade command with the whitelist option:
# satellite-maintain upgrade run --whitelist="non-rh-packages"
It shows the following error:
~~~
/Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns
rake aborted!
StandardError: An error has occurred; this and all later migrations canceled:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_katello_installed_packages_on_nvrea"
DETAIL: Key (nvrea)=(gcc-objc++-4.8.5-39.el7.x86_64) already exists.
~~~
Expected results:
The upgrade should be completed without error.
- clones
-
SAT-34064 Satellite 6.17 upgrade fails with ERROR: duplicate key value violates unique constraint "index_katello_installed_packages_on_nvrea"
-
- Closed
-
- duplicates
-
SAT-35461 Restoring Red Hat Satellite 6 is impossible when the backup contains db duplicate issues.
-
- Release Pending
-
-
SAT-38395 Restoring Red Hat Satellite 6 is impossible when the backup contains db duplicate issues.
-
- Closed
-
- links to
-
RHSA-2025:152331 Satellite 6.17.3 Async Update