Bug 852072 - error handling for repo uploads for non rpm
Summary: error handling for repo uploads for non rpm
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 2.0.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 40
Assignee: Jay Dobies
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-27 14:10 UTC by Preethi Thomas
Modified: 2013-09-09 16:26 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-09 17:04:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2012-08-27 14:10:24 UTC
Description of problem:

Needs a better error handling when uploading files that are not rpm

Version-Release number of selected component (if applicable):
[root@pulp-candidate ~]# rpm -qa pulp-rpm-server
pulp-rpm-server-2.0.1-1.fc17.noarch
[root@pulp-candidate ~]# 


How reproducible:


Steps to Reproduce:
1. [root@pulp-candidate ~]# pulp-admin repo uploads  rpm  --repo-id new-repo --file install.log
+----------------------------------------------------------------------+
                               RPM Upload
+----------------------------------------------------------------------+

Extracting necessary metdata for each RPM...
[==================================================] 100%
Analyzing: install.log
An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.


2.
3.
  
Actual results:


Expected results:


Additional info:

2012-08-27 10:06:30,781 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 475, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 891, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 184, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/pulp/admin/extensions/rpm_upload/pulp_cli.py", line 115, in create
    unit_key, metadata = _generate_rpm_data(f)
  File "/usr/lib/pulp/admin/extensions/rpm_upload/pulp_cli.py", line 173, in _generate_rpm_data
    headers = ts.hdrFromFdno(fd)
  File "/usr/lib64/python2.7/site-packages/rpm/transaction.py", line 154, in hdrFromFdno
    raise rpm.error("error reading package header")
error: error reading package header

Comment 1 Jay Dobies 2012-10-03 19:21:09 UTC
Added a much more graceful way of telling the user:

$ pulp-admin rpm repo uploads rpm --repo-id bz --file /tmp/non-rpm
+----------------------------------------------------------------------+
                          Puppet Module Upload
+----------------------------------------------------------------------+

Extracting necessary metdata for each request...
[==================================================] 100%
Analyzing: non-rpm
error: not an rpm package

Metadata for /tmp/non-rpm could not be generated. The specific error is as
follows:

The given file is not a valid RPM

Comment 2 Jay Dobies 2012-10-05 17:36:49 UTC
 Merge pull request #91 from pulp/jdob-852072

852072 - Added the ability to circumvent the upload workflow in the

commit 80f34418c36d52077bf9a731fff7cf745b7cb4cd

Comment 3 Jeff Ortel 2012-10-05 21:43:08 UTC
build: 0.331

Comment 4 Preethi Thomas 2012-10-11 14:43:52 UTC
[root@pulp-master ~]# rpm -q pulp-rpm-server
pulp-rpm-server-0.0.331-1.fc17.noarch
[root@pulp-master ~]# 


[root@pulp-master ~]# pulp-admin rpm repo uploads rpm --repo-id pulp --file  install.log
+----------------------------------------------------------------------+
                          Puppet Module Upload
+----------------------------------------------------------------------+

Extracting necessary metdata for each request...
[==================================================] 100%
Analyzing: install.log

Metadata for install.log could not be generated. The specific error is as
follows:

The given file is not a valid RPM

[root@pulp-master ~]#

Comment 5 Preethi Thomas 2013-01-09 17:04:00 UTC
Pulp v2.0 released


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