Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1191752 - Duplicate Resource Error When Promoting Content
Duplicate Resource Error When Promoting Content
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management (Show other bugs)
6.0.8
Unspecified Unspecified
urgent Severity high (vote)
: 6.1.5
: Unused
Assigned To: Justin Sherrill
Katello QA List
: Reopened, Triaged
Depends On:
Blocks: 1202790
  Show dependency treegraph
 
Reported: 2015-02-11 16:43 EST by Mike McCune
Modified: 2017-02-23 14:23 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1202790 (view as bug list)
Environment:
Last Closed: 2017-01-16 18:44:22 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike McCune 2015-02-11 16:43:02 EST
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 16:48:22 EST
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 11:01:01 EST
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 12:39:39 EST
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 12:45:34 EDT
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@redhat.com and dcaplan@redhat.com with any issues.
Comment 8 Greg West 2015-09-04 13:59:32 EDT
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 14:02:45 EDT
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.