Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1202790

Summary: Duplicate Resource Error When Promoting Content
Product: Red Hat Satellite Reporter: Bryan Kearney <bkearney>
Component: Content ManagementAssignee: Justin Sherrill <jsherril>
Status: CLOSED CURRENTRELEASE QA Contact: Tazim Kolhar <tkolhar>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.8CC: andrew.schofield, bbuckingham, cwelton, greg-bz, jmontleo, jsherril, kabbott, katello-qa-list, mmccune, sthirugn, tkolhar
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1191752 Environment:
Last Closed: 2015-08-12 16:05:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1191752    
Bug Blocks:    
Attachments:
Description Flags
puppet environment
none
foreman-debug attached none

Comment 2 Justin Sherrill 2015-03-17 17:36:05 UTC
Yes, this is already downstream in 6.1.0.  Moving to modified.

Comment 3 Tazim Kolhar 2015-04-29 10:11:09 UTC
FAILEDQA:

rpm -qa | grep foreman
foreman-proxy-1.7.2.4-1.el7sat.noarch
dhcp201-110.englab.pnq.redhat.com-foreman-client-1.0-1.noarch
dhcp201-110.englab.pnq.redhat.com-foreman-proxy-1.0-2.noarch
foreman-1.7.2.17-1.el7sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.9-1.el7sat.noarch
foreman-libvirt-1.7.2.17-1.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.10-1.el7sat.noarch
foreman-postgresql-1.7.2.17-1.el7sat.noarch
foreman-vmware-1.7.2.17-1.el7sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.7-1.el7sat.noarch
ruby193-rubygem-foreman_docker-1.2.0.9-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.1.0-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.12.3-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.3-1.el7sat.noarch
foreman-compute-1.7.2.17-1.el7sat.noarch
foreman-ovirt-1.7.2.17-1.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.5-1.el7sat.noarch
foreman-selinux-1.7.2.13-1.el7sat.noarch
puppet-foreman_scap_client-0.3.3-7.el7sat.noarch
foreman-gce-1.7.2.17-1.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.9-1.el7sat.noarch
foreman-debug-1.7.2.17-1.el7sat.noarch
dhcp201-110.englab.pnq.redhat.com-foreman-proxy-client-1.0-1.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch

steps:
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'

screenshot attached

Comment 4 Tazim Kolhar 2015-04-29 10:11:56 UTC
Created attachment 1020065 [details]
puppet environment

Comment 5 Tazim Kolhar 2015-04-29 10:15:08 UTC
Created attachment 1020066 [details]
foreman-debug attached

Comment 6 Tazim Kolhar 2015-08-10 10:15:18 UTC
VERIFIED:
# rpm -qa | grep foreman
foreman-vmware-1.7.2.33-1.el6_6sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el6_6sat.noarch
foreman-postgresql-1.7.2.33-1.el6_6sat.noarch
foreman-ovirt-1.7.2.33-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.9-1.el6_6sat.noarch
tyan-gt24-12.rhts.eng.bos.redhat.com-foreman-proxy-1.0-2.noarch
foreman-compute-1.7.2.33-1.el6_6sat.noarch
ruby193-rubygem-foreman_docker-1.2.0.18-1.el6_6sat.noarch
ruby193-rubygem-foreman-redhat_access-0.2.1-1.el6_6sat.noarch
tyan-gt24-12.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el6_6sat.noarch
tyan-gt24-12.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
foreman-debug-1.7.2.33-1.el6_6sat.noarch
foreman-1.7.2.33-1.el6_6sat.noarch
foreman-gce-1.7.2.33-1.el6_6sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el6_6sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el6_6sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.19-1.el6_6sat.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el6_6sat.noarch
foreman-selinux-1.7.2.13-1.el6_6sat.noarch
foreman-libvirt-1.7.2.33-1.el6_6sat.noarch
ruby193-rubygem-foreman-tasks-0.6.15.4-1.el6_6sat.noarch
foreman-proxy-1.7.2.5-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.5-1.el6_6sat.noarch



steps:
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:
You are able to continuously try to publish and get the same "Puppet environment can't be black error", it does not cause a duplicate resource issue.    

Also, I tried additional steps though the duplicate resource does not occur:
# curl http://people.redhat.com/~mmccune/duplicate_repos.rake > /usr/share/foreman/lib/tasks/duplicate_repos.rake
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   828  100   828    0     0   2328      0 --:--:-- --:--:-- --:--:--  2338

# foreman-rake katello:duplicate_repos

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

# foreman-rake katello:duplicate_repos delete=true

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

Deleting duplicate repositories

Done deleting.

Comment 7 Bryan Kearney 2015-08-12 16:05:16 UTC
This bug was fixed in Satellite 6.1.1 which was delivered on 12 August, 2015.

Comment 8 Greg West 2015-09-04 18:01:11 UTC
I believe I am experiencing the same behaviour with 6.1.1.
I can reproduce the problem using the same steps described