Bug 845010

Summary: Creating a second repo with the same feed is successful but fails to create any repos after.
Product: [Retired] Pulp Reporter: Preethi Thomas <pthomas>
Component: user-experienceAssignee: Barnaby Court <bcourt>
Status: CLOSED DUPLICATE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: high    
Version: MasterCC: jason.dobies, mhrivnak, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-09 17:23:00 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
pulp.log none

Description Preethi Thomas 2012-08-01 13:16:08 UTC
Created attachment 601745 [details]
pulp.log

Description of problem:

Using the same feed to create a 2nd repo is successful. But gets conflicting relative path error when creating any repos with any feed.

Version-Release number of selected component (if applicable):
[root@preethi-el6-pulp ~]# rpm -qa |grep pulp
python-pulp-common-0.0.319-1.el6.noarch
python-pulp-client-lib-0.0.319-1.el6.noarch
pulp-rpm-admin-extensions-0.0.319-1.el6.noarch
mod_wsgi-3.3-4.pulp.el6.x86_64
python-pulp-rpm-common-0.0.319-1.el6.noarch
pulp-rpm-plugins-0.0.319-1.el6.noarch
python-pulp-bindings-0.0.319-1.el6.noarch
pulp-admin-client-0.0.319-1.el6.noarch
pulp-rpm-admin-client-0.0.319-1.el6.noarch
python-oauth2-1.5.170-3.pulp.el6.noarch
m2crypto-0.21.1.pulp-8.el6.x86_64
pulp-server-0.0.319-1.el6.noarch
pulp-builtins-admin-extensions-0.0.319-1.el6.noarch
pulp-rpm-server-0.0.319-1.el6.noarch
[root@preethi-el6-pulp ~]# 


How reproducible:


Steps to Reproduce:
1. create repo pulp with feed http://repos.fedorapeople.org/repos/pulp/pulp/v2/testing/fedora-17/

2. Sync the repo

3.create a second repo pulp-1 with same feed http://repos.fedorapeople.org/repos/pulp/pulp/v2/testing/fedora-17/

4. Create a 3rd repo with any feed eg: http://download.devel.redhat.com/released/F-16/GOLD/Fedora/x86_64/os/
  
Actual results:

[root@preethi-el6-pulp ~]# pulp-admin repo create --repo-id=f15 --feed=http://download.devel.redhat.com/released/F-16/GOLD/Fedora/x86_64/os/
The server indicated one or more values were incorrect. The server provided the
following error message:

   Pulp exception occurred: PulpDataException

More information can be found in the client log file ~/.pulp/admin.log.
Expected results:


Additional info:
from admin.log

2012-08-01 08:58:46,175 - ERROR - Exception occurred:
        href:      /pulp/api/v2/repositories/
        method:    POST
        status:    400
        error:     Pulp exception occurred: PulpDataException
        traceback: None
        data:      {u'args': [[u"Relative URL lookup table encountered a conflict with repo <pulp-1> with relative_url </repos/pulp/pulp/v2/testing/fedora-17/> broken into [u'repos', u'pulp', u'pulp', u'v2', u'testing', u'fedora-17'].\nThis repo <pulp-1> conflicts with an existing repos sub directories, specific sub dirs of conflict are {u'x86_64': {'url': u'/repos/pulp/pulp/v2/testing/fedora-17/x86_64/', 'repo_id': u'pulp'}}"]]}

Comment 1 Michael Hrivnak 2013-09-04 21:29:15 UTC
Turning this over to Barnaby, who recently did work in this area. Creating two repos in a row with the same feed now produces an error, but not the helpful kind. Here is the second create:

$ pulp-admin rpm repo create --repo-id=zoo2 --feed=http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/
The server indicated one or more values were incorrect. The server provided the
following error message:

   Pulp exception occurred: PulpDataException

More information can be found in the client log file ~/.pulp/admin.log.


An here is pulp.log:

Traceback (most recent call last):
  File "/home/mhrivnak/git/pulp/server/pulp/server/managers/repo/distributor.py", line 169, in add_distributor
    result = distributor_instance.validate_config(transfer_repo, call_config, config_conduit)
  File "/usr/lib/pulp/plugins/distributors/yum_distributor/distributor.py", line 217, in validate_config
    if conflict_items.count() > 0:
TypeError: count() takes exactly one argument (0 given)


I think that on the line linked below, you want "len(conflict_items)" instead of "conflict_items.count()". It's also pythonic to just say "if conflict_items:"

Comment 2 Barnaby Court 2013-09-09 17:23:00 UTC
This item was also fixed by 1004897

*** This bug has been marked as a duplicate of bug 1004897 ***