Bug 1191752 - Duplicate Resource Error When Promoting Content
Summary: Duplicate Resource Error When Promoting Content
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.0.8
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: 1202790
TreeView+ depends on / blocked
 
Reported: 2015-02-11 21:43 UTC by Mike McCune
Modified: 2020-02-14 17:28 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1202790 (view as bug list)
Environment:
Last Closed: 2017-01-16 23:44:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mike McCune 2015-02-11 21:43:02 UTC
Getting an errror the Web UI when trying to promote a content view from my Dev lifecycle environment to my Staging lifecycle environment.


 Duplicate resource: Acme-Staging-Test_View-Acme-Acme_Example_RPMs

We need a way to:

1) prevent this from happening in the future

2) method for cleaning up conflicting records in Pulp to assist when customers get into this situation.

Comment 1 Justin Sherrill 2015-02-11 21:48:22 UTC
Some notes:



Various actions in katello:

Content View Publish
Content View Promote
Enable Repo

end up creating a repo in pulp.  Due to a change that was made for 6.0.4, there is an opportunity for another error to cause a repository to be created in pulp but not katello. 

This only occurs when something else goes wrong, but due to this issue the user is unable to re-attempt the same action, becuase they will get a "Duplicate Resource" error. (the repo has been created in pulp).



To reproduce we need to get Katello into an error state.  To do so we will exploit a known bug:

Steps to Reproduce:
1. Create a content view
2. Publish the content view
3. Go to the puppet environments page
4. Delete the puppet environment
5. Publish a new version of the content view
       you will get an error: ' Validation failed: Puppet environment can't be blank'
6. Try to publish again:
       Duplicate Resource SOME_PULP_ID

You should be able to continuously try to publish and get the same "Puppet environment can't be black error", it should not cause a duplicate resource issue.


I'm sure there are many ways to exploit this duplicate resource problem, as i have seen many customers hit it.

Comment 4 Justin Sherrill 2015-02-12 16:01:01 UTC
Sorry, missed a step in the steps above:


Steps to Reproduce:
1. Create a custom repo
2. Create a content view
3. Add a custom repo to the content view
4. Publish the content view
5. Go to the puppet environments page
6. Delete the puppet environment
7. Publish a new version of the content view
       you will get an error: ' Validation failed: Puppet environment can't be blank'
8. Try to publish again:
       Duplicate Resource SOME_PULP_ID

Comment 5 Mike McCune 2015-02-12 17:39:39 UTC
Cleanup Procedure if you are hit by this bug:

1) Download duplicate detection and cleanup script:

# curl http://people.redhat.com/~mmccune/duplicate_repos.rake > /usr/share/foreman/lib/tasks/duplicate_repos.rake

2) Get list of duplicate repositories

# foreman-rake katello:duplicate_repos

List of repository IDs that exist only in Pulp that need to get deleted:

  * Default_Organization-dupe-resource-test-2-Custom_DEMO-demo1

3) If the above output lists the repos that are blocking a publish or promote then run:

# foreman-rake katello:duplicate_repos delete=true

List of repository IDs that exist only in Pulp that need to get deleted:

  * Default_Organization-dupe-resource-test-2-Custom_DEMO-demo1
Deleting duplicate repositories

Done deleting.

At this point attempt to republish your Content View.  Depending on the root cause of the duplicate repository this may or may not resolve the error during Content View publish

Comment 7 Bryan Kearney 2015-06-30 16:45:34 UTC
This bug is planned to be resolved in the Satellite 6.1 code base in bug https://bugzilla.redhat.com/show_bug.cgi?id=1202790. We are not planning to backport this to 6.0, and are therefore closing out this bug. Please feel free to contact bkearney and dcaplan with any issues.

Comment 8 Greg West 2015-09-04 17:59:32 UTC
I have the same issue with Satellite 6.1.1. The same steps to reproduce are valid.
Unfortunately Mike's cleanup procedure did not work in this case.

Comment 9 Mike McCune 2015-10-13 18:02:45 UTC
re-opening this as it appears to occur in certain circumstances in 6.1.X


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