Bug 747026 - pulp-admin repo list produce IndexError
Summary: pulp-admin repo list produce IndexError
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jason Dobies
QA Contact: dgao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-18 15:27 UTC by dgao
Modified: 2013-09-09 16:29 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-24 20:14:39 UTC


Attachments (Terms of Use)

Description dgao 2011-10-18 15:27:50 UTC
[root@pulp-qe pulp]# mongo
MongoDB shell version: 1.6.4
connecting to: test
> 
> db.dropDatabase()
{ "dropped" : "test", "ok" : 1 }
> bye
[root@pulp-qe gofer]# /etc/init.d/pulp-server init
data model in use matches the current version
database migration to version 23 complete
[root@pulp-qe gofer]# /etc/init.d/pulp-server restart
Stopping httpd:                                            [  OK  ]
Stopping Qpid AMQP daemon:                                 [  OK  ]
Stopping mongod:                                           [  OK  ]
Starting mongod:                                           [  OK  ]
Starting Qpid AMQP daemon:                                 [  OK  ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using pulp-qe.usersys.redhat.com for ServerName
                                                           [  OK  ]
[root@pulp-qe gofer]# yum clean all
Loaded plugins: pulp-profile-update
Cleaning repos: fedora testing-fedora-pulp updates
Cleaning up Everything
[root@pulp-qe gofer]# yum info pulp
Loaded plugins: pulp-profile-update
fedora/metalink                                                                                                                                                               |  23 kB     00:00     
fedora                                                                                                                                                                        | 4.3 kB     00:00     
fedora/primary_db                                                                                                                                                             |  14 MB     00:23     
testing-fedora-pulp                                                                                                                                                           | 1.3 kB     00:00     
testing-fedora-pulp/primary                                                                                                                                                   | 5.4 kB     00:00     
testing-fedora-pulp                                                                                                                                                                            17/17
updates/metalink                                                                                                                                                              |  17 kB     00:00     
updates                                                                                                                                                                       | 4.7 kB     00:00     
updates/primary_db                                                                                                                                                            | 6.5 MB     00:10     
Installed Packages
Name        : pulp
Arch        : noarch
Version     : 0.0.239
Release     : 1.fc14
Size        : 2.7 M
Repo        : installed
From repo   : testing-fedora-pulp
Summary     : An application for managing software content
URL         : https://fedorahosted.org/pulp/
License     : GPLv2
Description : Pulp provides replication, access, and accounting for software repositories.

[root@pulp-qe gofer]# pulp-admin auth login -u admin -p admin
User credentials successfully stored at [/root/.pulp/user-cert.pem]

[root@pulp-qe gofer]# pulp-admin repo list
error: operation failed: IndexError: list index out of range

---pulp.log---

2011-10-18 11:20:51,614 5258:140610409309952: pulp.server.webservices.controllers.decorators:ERROR: decorators:52 Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 48, in report_error
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 127, in _auth_decorator
    value = method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 155, in _query_decortator
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/repositories.py", line 194, in GET
    repo['uri'] = serialization.repo.v1_uri(repo)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/serialization/repo.py", line 58, in v1_uri
    return cds['next_permutation'][0]
IndexError: list index out of range

Comment 1 Jason Connor 2011-10-28 20:28:16 UTC
This is likely a bug in the cds unassociate code. For some reason when a repo has been unassociated from cds, the following still returns a cds instance:

    cds = round_robin._find_association(repo['id'])
    if cds is not None:
        return cds['next_permutation'][0]

re-assigning to jdobies

Comment 2 Jay Dobies 2011-10-28 20:36:12 UTC
I was just in there fixing another bug, it's possible it was related to that change.

But David, can you give a little more context to what your setup was? Screen grabs are nice but, especially when dealing with a setup with CDS instances, I really can't do much to reproduce it if I don't know what you did to set it up in the first place.

Comment 3 Jay Dobies 2011-10-31 14:50:13 UTC
commit b11195f26401a152ab2fa4639b713543c3dfd385
Author: Jay Dobies <jason.dobies>
Date:   Mon Oct 31 10:49:16 2011 -0400

    747026 - When removing a CDS/repo association, remove the association
    document if no more CDSes are assigned for the given repo.

src/pulp/server/cds/round_robin.py
src/pulp/server/webservices/serialization/repo.py
test/unit/test_round_robin.py


Side note: I added a note in the serialization module that it was done incorrectly. It bypasses the round-robin concept entirely by calling to a private method and always returning a single URL. It will need to be addressed in the future.

Comment 4 Jay Dobies 2011-11-09 20:32:11 UTC
Fixed in build 0.247.

Comment 5 dgao 2011-11-10 20:21:36 UTC
Verified, no longer seeing this in automation or manual testing.

Comment 6 Preethi Thomas 2012-02-24 20:14:39 UTC
Pulp v1.0 is released
Closed Current Release.

Comment 7 Preethi Thomas 2012-02-24 20:19:34 UTC
Pulp v1.0 is released.


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