Bug #34870
closedPG::ForeignKeyViolation: ERROR: update or delete on table "katello_erratum_packages" violates foreign key constraint "katello_msep_erratum_package_id_fk" on table "katello_module_stream_erratum_packages"
Description
Description of problem:
Upgrading to 6.10.5 fails with below error:
root@ctqlsat06 ~]# foreman-rake db:migrate --trace --verbose'ErbParser' is ignored.
'RubyParser' is ignored.
- Invoke db:migrate (first_time)
- Invoke db:load_config (first_time)
- Invoke environment (first_time)
- Execute environment
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache. - Execute db:load_config
- Invoke plugin:refresh_migrations (first_time)
- Invoke environment
- Execute plugin:refresh_migrations
- Execute db:migrate
20220303160220 RemoveDuplicateErrata: migrating ==========================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::ForeignKeyViolation: ERROR: update or delete on table "katello_erratum_packages" violates foreign key constraint "katello_msep_erratum_package_id_fk" on table "katello_module_stream_erratum_packages"
DETAIL: Key (id)=(264838) is still referenced from table "katello_module_stream_erratum_packages".
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `async_exec_params'
Version-Release number of selected component (if applicable):
How reproducible:
Unknown as it happens on one of the customers' Satellite
Steps to Reproduce:
1.
2.
3.
Actual results:
failed upgrade due to failing db:migrate
Expected results:
successful upgrade
Additional info:
It's quite similar to bz#2075519, but this happens on a different table.
Updated by The Foreman Bot over 2 years ago
- Status changed from New to Ready For Testing
- Assignee set to Samir Jha
- Pull request https://github.com/Katello/katello/pull/10093 added
Updated by The Foreman Bot over 2 years ago
- Fixed in Releases Katello 4.5.0 added
Updated by Samir Jha over 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|a3ce2c5216a6ca650ec1ff4b45c9cb83a5402136.
Updated by Ian Ballou over 2 years ago
- Subject changed from PG::ForeignKeyViolation: ERROR: update or delete on table "katello_erratum_packages" violates foreign key constraint "katello_msep_erratum_package_id_fk" on table "katello_module_stream_erratum_packages" to PG::ForeignKeyViolation: ERROR: update or delete on table "katello_erratum_packages" violates foreign key constraint "katello_msep_erratum_package_id_fk" on table "katello_module_stream_erratum_packages"
- Target version set to Katello 4.4.1
- Triaged changed from No to Yes