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 1581700 - Error deleting manifest. PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_katello_pools_on_cp_id"
Summary: Error deleting manifest. PG::UniqueViolation: ERROR: duplicate key value viol...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.4.0
Assignee: Partha Aji
QA Contact: Nikhil Kathole
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-23 12:37 UTC by Nikhil Kathole
Modified: 2019-11-05 23:20 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:02:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
screenshot of UI (102.93 KB, image/png)
2018-05-23 12:37 UTC, Nikhil Kathole
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 23942 0 Normal Closed Error deleting manifest. PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_katello_pools... 2020-10-27 19:10:51 UTC

Description Nikhil Kathole 2018-05-23 12:37:39 UTC
Created attachment 1440562 [details]
screenshot of UI

Description of problem: Trying to delete manifest after upgrade to satellite 6.4 snap 4 from satellite 6.3.1, gives error  Error deleting manifest. PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_katello_pools_on_cp_id" DETAIL: Key (cp_id)=(8a88f7815e22b340015e22bc74ea0196) already exists. : INSERT INTO "katello_pools" ("cp_id", "created_at", "updated_at", "organization_id") VALUES ($1, $2, $3, $4) RETURNING "id"

Version-Release number of selected component (if applicable): Satellite 6.4


How reproducible: always


Steps to Reproduce:
1. Upgrade satellite to 6.4 snap 4
2. Upload manifest
3. Try to delete manifest

Actual results:

Error deleting manifest. PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_katello_pools_on_cp_id"

and production.log showed

2018-05-23T08:25:31 [W|app|f29fc] Orphaned Product id 883 found while refreshing/importing manifest.
2018-05-23T08:25:31 [W|app|f29fc] Orphaned Product id 882 found while refreshing/importing manifest.
2018-05-23T08:25:31 [W|app|f29fc] Orphaned Product id 881 found while refreshing/importing manifest.
2018-05-23T08:25:31 [W|app|f29fc] Orphaned Product id 880 found while refreshing/importing manifest.
2018-05-23T08:25:31 [W|app|f29fc] Orphaned Product id 879 found while refreshing/importing manifest.
2018-05-23T08:25:31 [W|app|f29fc] Orphaned Product id 878 found while refreshing/importing manifest.
2018-05-23T08:25:34 [I|aud|] update event for Organization with id 36
2018-05-23T08:30:15 [E|bac|] PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_katello_pools_on_cp_id"
DETAIL:  Key (cp_id)=(8a88f7815e22b340015e22bc74ea0196) already exists.
: INSERT INTO "katello_pools" ("cp_id", "created_at", "updated_at", "organization_id") VALUES ($1, $2, $3, $4) RETURNING "id" (ActiveRecord::RecordNotUnique)
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:614:in `async_exec'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:614:in `block (2 levels) in exec_no_cache'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:46:in `block in permit_concurrent_loads'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:185:in `yield_shares'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:45:in `permit_concurrent_loads'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:613:in `block in exec_no_cache'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract_adapter.rb:612:in `block (2 levels) in log'
/opt/rh/rh-ruby24/root/usr/share/ruby/monitor.rb:214:in `mon_synchronize'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract_adapter.rb:611:in `block in log'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract_adapter.rb:603:in `log'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:612:in `exec_no_cache'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:601:in `execute_and_clear'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:79:in `exec_query'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:102:in `exec_insert'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:113:in `exec_insert'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:133:in `insert'


Expected results: Manifest delete success.


Additional info:

Comment 7 Brad Buckingham 2018-05-24 12:43:48 UTC
Nikhil,

Does this only occur on an upgraded Satellite?

Comment 8 Brad Buckingham 2018-05-24 12:47:16 UTC
Clearing needinfo.  Sachin mentioned on standup that doesn't happen on new install.

Comment 10 Jonathon Turel 2018-06-14 15:17:32 UTC
Created redmine issue http://projects.theforeman.org/issues/23942 from this bug

Comment 11 Satellite Program 2018-07-09 14:14:39 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23942 has been resolved.

Comment 12 Nikhil Kathole 2018-07-23 08:13:51 UTC
VERIFIED

Version tested:
Satellite 6.4 snap 13

Upgraded satellite from 6.3.2 to 6.4 snap 13, manifest deletion is successful.

Comment 13 Bryan Kearney 2018-10-16 19:02:36 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, 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/RHSA-2018:2927


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