Bug #35031
20211220185935_clean_duplicate_content_units db:migrate fails with child records
Description
During db:migrate the database patch 20211220185935_clean_duplicate_content_units.rb is applied, but fails with the following error in /var/log/foreman-installer/katello.log:
2022-06-07 08:48:45 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: PG::ForeignKeyViolation: ERROR: update or delete on table "katello_module_profiles" violates foreign key constraint "katello_mod_profile_rpm_mod_profile_id_fk" on table "katello_module_profile_rpms" 2022-06-07 08:48:45 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: DETAIL: Key (id)=(22) is still referenced from table "katello_module_profile_rpms".
More details here: https://community.theforeman.org/t/foreignkeyviolation-on-katello-module-profiles-during-db-migrate/28926
Associated revisions
History
#1
Updated by William Clark 8 months ago
- Triaged changed from No to Yes
- Target version set to Katello 4.4.2
#2
Updated by Florian Faltermeier 8 months ago
Samir Jha wrote:
During db:migrate the database patch 20211220185935_clean_duplicate_content_units.rb is applied, but fails with the following error in /var/log/foreman-installer/katello.log:
[...]
More details here: https://community.theforeman.org/t/foreignkeyviolation-on-katello-module-profiles-during-db-migrate/28926
Same issue happens to me on upgrade vom Katello 4.3 to 4.4
Florian
#3
Updated by Vladislav Bulygin 7 months ago
Samir Jha wrote:
During db:migrate the database patch 20211220185935_clean_duplicate_content_units.rb is applied, but fails with the following error in /var/log/foreman-installer/katello.log:
[...]
More details here: https://community.theforeman.org/t/foreignkeyviolation-on-katello-module-profiles-during-db-migrate/28926
Same problem with same versions.
#4
Updated by The Foreman Bot 7 months ago
- Assignee set to Samir Jha
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/10196 added
#5
Updated by The Foreman Bot 6 months ago
- Fixed in Releases Katello 4.6.0 added
#6
Updated by Samir Jha 6 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|667324096159ef6c0950b40588e3f04cc427c1eb.
Fixes #35031 - Delete ModuleProfile and ModuleProfileRpms before ModuleStreams (#10196)