Bug 1061130 - Corrupted data in api call import_upload for rpm causes server-side error with no explanation
Summary: Corrupted data in api call import_upload for rpm causes server-side error wit...
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: unspecified
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 2.6.0
Assignee: Michael Hrivnak
QA Contact: Preethi Thomas
Depends On:
TreeView+ depends on / blocked
Reported: 2014-02-04 12:25 UTC by Tomas Kopecek
Modified: 2015-02-28 22:02 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-02-28 22:02:23 UTC

Attachments (Terms of Use)
script to reproduce (712 bytes, text/plain)
2015-01-02 21:47 UTC, Michael Hrivnak
no flags Details

System ID Private Priority Status Summary Last Updated
Pulp Redmine 395 0 None None None Never

Description Tomas Kopecek 2014-02-04 12:25:22 UTC
When I try upload to upload correct rpm metadata with corrupted import, I've got only HTTP 500 with no correct error response. Not sure what happened on server and if there is everything reverted correctly. It can happen even in normal process - incompletely uploaded file, or corrupted on the way.

I want to get some error message like 'File doesn't match metadata'.

parse unit_key/metadata for rpm:
{'arch': 'noarch',
 'checksum': '8e1dd60ef4c59ca7864ed9c5a818a3f087b544f469259f163a9fa80da73bd2e4',
 'checksumtype': 'sha256',
 'epoch': '0',
 'name': 'pulp-nodes-consumer-extensions',
 'release': '1.fc19',
 'version': '2.3.1'}
{'buildhost': 'localhost',
 'description': 'Pulp nodes consumer client extensions.',
 'filename': 'pulp-nodes-consumer-extensions-2.3.1-1.fc19.noarch.rpm',
 'license': 'GPLv2',
 'relativepath': 'pulp-nodes-consumer-extensions-2.3.1-1.fc19.noarch.rpm',
 'vendor': None}

upload incorrect file:
upload_id = upload_api.initialize_upload().response_body['upload_id']:
upload_api.upload_segment(upload_id, 0, 'bogus_data')
upload_api.import_upload(upload_id, NOCHANNEL_REPO, 'rpm', unit_key, metadata)

got ApacheException with messsage:
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 sysadmin-engops and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>

Comment 1 Michael Hrivnak 2015-01-02 21:47:25 UTC
Created attachment 975401 [details]
script to reproduce

This script should reproduce the problem, but it seems to show that the problem no longer exists.

To use, create an rpm repo named "foo" first, then run the script. Adjust credentials in the script as necessary.

Comment 2 Michael Hrivnak 2015-01-02 21:49:29 UTC
This seems to have been fixed at some point in the past. See script above for a reproducer. It should print that all response codes are 20x, like this:

$ ./1061130.py 
initialize: 201
upload segment: 200
import upload: 202

Comment 3 Preethi Thomas 2015-01-29 15:09:05 UTC
[root@cloud-qe-4 ~]# rpm -qa pulp-server
[root@cloud-qe-4 ~]# 

[root@cloud-qe-4 ~]# ./upload.py 
initialize: 201
upload segment: 200
import upload: 202
[root@cloud-qe-4 ~]#

Comment 4 Brian Bouterse 2015-02-28 22:02:23 UTC
Moved to https://pulp.plan.io/issues/395

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