Bug 852072 - error handling for repo uploads for non rpm
error handling for repo uploads for non rpm
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: user-experience (Show other bugs)
2.0.6
Unspecified Unspecified
unspecified Severity unspecified
: ---
: Sprint 40
Assigned To: Jay Dobies
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-27 10:10 EDT by Preethi Thomas
Modified: 2013-09-09 12:26 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-09 12:04:00 EST
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 Preethi Thomas 2012-08-27 10:10:24 EDT
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 15:21:09 EDT
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 13:36:49 EDT
 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 17:43:08 EDT
build: 0.331
Comment 4 Preethi Thomas 2012-10-11 10:43:52 EDT
[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 12:04:00 EST
Pulp v2.0 released

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