Bug 845941

Summary: Custom repository relative path prefix collision
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: mkovacik
Component: RHUAAssignee: James Slagle <jslagle>
Status: CLOSED ERRATA QA Contact: mkovacik
Severity: unspecified Docs Contact:
Priority: high    
Version: 2.1CC: juwu, tsanders, vkuznets, whayutin
Target Milestone: ---   
Target Release: 2.1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Creating two or more repository paths with the same prefix returned an error. This bug fix corrects how Red Hat Update Appliance checks the repository paths and allows repository paths to share the same prefix.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-27 16:59:19 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:
Attachments:
Description Flags
Screen log
none
Verification log none

Description mkovacik 2012-08-06 08:07:07 UTC
Created attachment 602456 [details]
Screen log

Description of problem:
If there is a repository with its relative path being a prefix of a new repository being created, an exception is thrown upon commit. If this is desirable behavior then documentation should mention such a limitation.

Version-Release number of selected component (if applicable):
 - build: RHEL-6.3-RHUI-2.1-20120801.0-Server-x86_64-DVD1.iso
 - pulp: 0.0.263-25.el6_3
 - rh-rhui-tools: 2.1.7-1.el6_3

How reproducible:
2 of 2 confirmed, but seems always

Steps to Reproduce:
1. create custom repository, id: 'prefix', with relative path: 'prefix'
2. create custom repository, id: 'prefix-1', with relative path: 'prefix-1/x86_64'
3. error committing repository id: 'prefix-1'
  
Actual results:
error trying create repository with its relative path being a prefix of another repository relative path


Expected results:
One is either able to create a repository with its relative path being a prefix of another repository relative path or the Documentation should mention the relative path limitation

Additional info:
 - see the screen log attached

Comment 1 wes hayutin 2012-08-07 00:08:16 UTC
I recreated the issue with two custom repositories that use the same path.

custom repo1 = /path/unprotected
custom repo2 = /path/protected

It appears that pulp no longer accepts that. We should confirm that the pulp behavior has changed and catch and prompt the user to use a different path if this is the case.

Comment 2 wes hayutin 2012-08-07 00:11:04 UTC
[root@ip-10-70-90-96 ~]# pulp-admin repo create --id unprotected1 --name unprotected1 --relativepath /path1/
Successfully created repository [ unprotected1 ]

[root@ip-10-70-90-96 ~]# pulp-admin repo create --id protected1 --name protected1 --relativepath /path1/
error:  operation failed: PulpException: New relative path [path1] conflicts with existing relative path [path1]; paths may not be a parent or child directory of another relative path

Comment 3 wes hayutin 2012-08-07 00:12:20 UTC
A fix in rhui-manager will not be complicated, but confirming pulp's behavior is what we want/expect w/ slagle..

Comment 4 James Slagle 2012-08-09 13:04:14 UTC
Yes, looks like there's an existing bug in Pulp with how we check the relative path for collisions on repo creation.  

Seeing as this is not a regression at this point, I think this is something we can fix in a 2.1.1

Comment 5 mkovacik 2013-01-16 13:42:35 UTC
From QA POW: is the path-prefix issue a supported case?

Comment 6 James Slagle 2013-01-23 22:45:33 UTC
commit 4359bc8618e615fe20a284bad33151547d977a9f to github.com/splice/pulp

Comment 7 Vitaly Kuznetsov 2013-02-05 14:11:32 UTC
Created attachment 693384 [details]
Verification log

Comment 8 Vitaly Kuznetsov 2013-02-05 14:12:39 UTC
Verified in pulp-0.0.263-27.el6_3.noarch (RHUI 2.1.1)

Comment 10 errata-xmlrpc 2013-02-27 16:59:19 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.

http://rhn.redhat.com/errata/RHBA-2013-0571.html