Bug 722576 - Cannot create multiple repos with the same name for different Products
Summary: Cannot create multiple repos with the same name for different Products
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Bryan Kearney
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2011-07-15 17:24 UTC by Corey Welton
Modified: 2019-09-26 13:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Postgres, F14
Last Closed: 2012-08-22 17:50:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Corey Welton 2011-07-15 17:24:21 UTC
Description of problem:
Trying to create multiple repos with the same name, even if they are associated with different products, fails with a constraint error.

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


How reproducible:


Steps to Reproduce:
1.  Create a new provider, "Google"
2.  Create a new product within Google, called "Google Talk Plugin"
3.  Create a new repo within Google Talk Plugin called "x86_64" and use the URL "http://dl.google.com/linux/talkplugin/rpm/stable/x86_64"
4.  Create a new product within Google, called "Google Chrome"
5.  Attempt to create a new repo within Google Chrome called "x86_64", and use the URL "http://dl.google.com/linux/chrome/rpm/stable/x86_64"
  
Actual results:

{"displayMessage":"Runtime Error org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError:2,598"}

Expected results:

Is it necessary to have a unique constraint on repo name when they are already part of separate products (and possibly in the case of separate providers [untested])?

Additional info:

If you repeat steps 4-5 using a unique name and try to rename it to "x86_64", you get a different, but probably related, error:

undefined method `values' for nil:NilClass

Comment 1 Corey Welton 2011-07-15 17:25:08 UTC
Not sure if this is a backend bug or not. At very least, the error should be captured cleanly in the frontend.  A separate bug can be created if necessary.

Comment 2 Mike McCune 2011-07-15 18:15:09 UTC
Users should definitely be able to create different repos in different products and providers with the same name.  We probably aren't adding enough uniqueness to the objects we are creating in Candlepin.

Comment 3 Jason E. Rist 2011-08-03 19:28:33 UTC
Seems like this is either backend or candlepin issue?

Comment 4 Dmitri Dolguikh 2011-08-16 12:53:14 UTC
candlepin contentent's label is now being prepended with product's candlepin id, while content name stays the same.

Comment 5 Sachin Ghai 2011-08-19 08:48:06 UTC
Verified with following katello build:

[root@dhcp201-207 katello]# rpm -qa | grep katello
katello-cli-0.1.4-1.git.63.54683c2.fc15.noarch
katello-0.1.64-1.git.0.0b431ff.fc15.noarch


I successfully created a provider "Google" and created 3 different products but with same name of repos under all 3 products without any error/exception on UI.

To confirm this, I verified from katello-cli:

[root@dhcp201-207 katello]# katello -u admin -p admin product list --org=ACME_Corporation | grep google
Name:        google_plugin
Name:        google_chrome
Name:        google_plus


[root@dhcp201-207 katello]# katello -u admin -p admin repo info --org=ACME_Corporation --repo=x86_64 --product=google_chrome
-------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                 Information About Repo None
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Id:            1313742299456-x86_64-ACME_Corporation
Name:          x86_64
Package Count: 0
Arch:          noarch
Url:           http://dl.google.com/linux/chrome/rpm/stable/x86_64
Last Sync:     never
Progress:      Not synced

[root@dhcp201-207 katello]# katello -u admin -p admin repo info --org=ACME_Corporation --repo=x86_64 --product=google_plugin
-------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                 Information About Repo None
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Id:            1313742160911-x86_64-ACME_Corporation
Name:          x86_64
Package Count: 0
Arch:          noarch
Url:           http://dl.google.com/linux/talkplugin/rpm/stable/x86_64
Last Sync:     never
Progress:      Not synced

Comment 8 Mike McCune 2013-08-16 18:16:16 UTC
getting rid of 6.0.0 version since that doesn't exist


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