Bug #34779
closedContent View publish fails with error PG::CardinalityViolation: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time.
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2070535
Description of problem:
Content View publish fails with error PG::CardinalityViolation: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
Version-Release number of selected component (if applicable):
6.10
How reproducible:
Customer Environment
Steps to Reproduce:
1. Create a content view using the below repository
~~
1) Id: 1
Name: Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server
Label: Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server
2) Id: 9
Name: Red Hat Enterprise Linux 7 Server - RH Common RPMs x86_64 7Server
Label: Red_Hat_Enterprise_Linux_7_Server_-_RH_Common_RPMs_x86_64_7Server
3) Id: 7
Name: Red Hat Enterprise Linux 7 Server - Optional RPMs x86_64 7Server
Label: Red_Hat_Enterprise_Linux_7_Server_-_Optional_RPMs_x86_64_7Server
4) Id: 6
Name: Red Hat Enterprise Linux 7 Server - Extras RPMs x86_64
Label: Red_Hat_Enterprise_Linux_7_Server_-_Extras_RPMs_x86_64
5) Id: 4
Name: Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7Server
Label: Red_Hat_Software_Collections_RPMs_for_Red_Hat_Enterprise_Linux_7_Server_x86_64_7Server
~~
2. Publish the content view and it will fail with the error "ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time".
Actual results:
Following error while publishing content view
Error:
PG::CardinalityViolation: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
HINT: Ensure that no rows proposed for insertion within the same command have duplicate constrained values.
Expected results:
Content view should be published without error.
Additional info:
Updated by Lucy Fu over 2 years ago
- Subject changed from Content View publish fails with error PG::CardinalityViolation: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time. to Content View publish fails with error PG::CardinalityViolation: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time.
fff4b701 | /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/insert_all.rb:27:in `execute'
fff4b701 | /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/persistence.rb:243:in `upsert_all'
fff4b701 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.39/app/models/katello/erratum.rb:96:in `update_repo_association_records'
fff4b701 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.39/app/models/katello/concerns/pulp_database_unit.rb:212:in `block in sync_repository_associations'
Method update_repo_association_records which throws out the error exists only with Katello 4.2 and 4.3 branch.
Updated by The Foreman Bot over 2 years ago
- Status changed from New to Ready For Testing
- Assignee set to Lucy Fu
- Pull request https://github.com/Katello/katello/pull/10065 added
Updated by Samir Jha over 2 years ago
- Target version set to Katello 4.3.2
- Triaged changed from No to Yes
Updated by Lucy Fu over 2 years ago
- Status changed from Ready For Testing to Closed