Bug 972909 - Unexpected error when using repo content rpm on a repository where uploads rpm was used
Unexpected error when using repo content rpm on a repository where uploads rp...
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: rpm-support (Show other bugs)
2.2 Beta
Unspecified Unspecified
high Severity high
: ---
: 2.2.0
Assigned To: Jay Dobies
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-10 15:11 EDT by Jeremy Cline
Modified: 2013-09-10 11:43 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-10 11:43:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeremy Cline 2013-06-10 15:11:57 EDT
Description of problem: When an rpm is uploaded with 'pulp-admin rpm repo uploads rpm', if 'pulp-admin rpm repo content rpm' is used on that repo, an unexpected error occurs. content rpm works on repos that have been synchronized, but if a repo contains any uploaded rpms it fails.


Version-Release number of selected component (if applicable): pulp-rpm-admin-extensions-2.2.0-0.2.beta.fc18.noarch


How reproducible:
This occurred with every rpm I tried

Steps to Reproduce:
1. pulp-admin rpm repo create --repo-id=buggy
2. pulp-admin rpm repo uploads rpm --repo-id=buggy --file=/home/jcline/bear-4.1-1.noarch.rpm
3. pulp-admin rpm repo content rpm --repo-id=buggy

Actual results:
An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.

Expected results:
Output similar to

Arch:         noarch
Buildhost:    smqe-ws15
Checksum:     7a831f9f90bf4d21027572cb503d20b702de8e8785b02c0397445c2e481d81b3
Checksumtype: sha256
Description:  A dummy package of bear
Epoch:        0
Filename:     bear-4.1-1.noarch.rpm
License:      GPLv2
Name:         bear
Provides:     bear = 4.1-1-0
Release:      1
Requires:     
Vendor:       None
Version:      4.1


Additional info:
[jcline@jcline ~]$ cat ~/.pulp/admin.log 
2013-06-10 14:31:35,425 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 478, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/extension/admin/contents.py", line 202, in package_search
    self.run_search([self.type_id], out_func=out_func, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/extension/admin/contents.py", line 157, in run_search
    out_func(units)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/extension/admin/contents.py", line 197, in out_func
    map(self._reformat_rpm_provides_requires, document_list)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/extension/admin/contents.py", line 241, in _reformat_rpm_provides_requires
    formatted_rpms = [process_one(r) for r in related_rpm_list]
  File "/usr/lib/python2.7/site-packages/pulp_rpm/extension/admin/contents.py", line 219, in process_one
    start = related_rpm['name']
TypeError: list indices must be integers, not str
Comment 1 Jay Dobies 2013-06-12 09:51:54 EDT
The format of the Provides/Requires fields changed with the new yum importer, but the approach of having the metadata parsed client-side on an upload wasn't updated accordingly.
Comment 2 Jeff Ortel 2013-06-17 16:18:53 EDT
build: 2.2.0-0.4.beta
Comment 3 Preethi Thomas 2013-06-19 09:24:44 EDT
verified
[root@ibm-x3550m3-13 ~]# rpm -q pulp-server
pulp-server-2.2.0-0.4.beta.fc18.noarch
[root@ibm-x3550m3-13 ~]# 

[root@ibm-x3550m3-13 ~]# pulp-admin rpm repo create --repo-id=buggy
Successfully created repository [buggy]

[root@ibm-x3550m3-13 ~]# pulp-admin rpm repo uploads rpm --repo-id=buggy  --file bear-4.1-1.noarch.rpm -v
+----------------------------------------------------------------------+
                              Unit Upload
+----------------------------------------------------------------------+

Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: bear-4.1-1.noarch.rpm
... completed

Files to be uploaded:
  bear-4.1-1.noarch.rpm

Creating upload requests on the server...
[==================================================] 100%
Initializing: bear-4.1-1.noarch.rpm
... completed

Starting upload of selected units. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
cancelled entirely using the cancel command.

Uploading: bear-4.1-1.noarch.rpm
[==================================================] 100%
2438/2438 bytes
... completed

Importing into the repository...
... completed

Deleting the upload request...
... completed

[root@ibm-x3550m3-13 ~]# pulp-admin rpm repo content rpm --repo-id=buggy
Arch:         noarch
Buildhost:    smqe-ws15
Checksum:     7a831f9f90bf4d21027572cb503d20b702de8e8785b02c0397445c2e481d81b3
Checksumtype: sha256
Description:  A dummy package of bear
Epoch:        0
Filename:     bear-4.1-1.noarch.rpm
License:      GPLv2
Name:         bear
Provides:     bear = 4.1-1-0
Release:      1
Requires:     
Vendor:       None
Version:      4.1


[root@ibm-x3550m3-13 ~]#
Comment 5 Preethi Thomas 2013-09-10 11:43:43 EDT
2.2 released
http://repos.fedorapeople.org/repos/pulp/pulp/stable/2.2/

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