Project

Profile

Help

Issue #395

Corrupted data in api call import_upload for rpm causes server-side error with no explanation

Added by tkopecek@redhat.com almost 7 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.6.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

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'.

reproducer:
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:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<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,
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>
</body></html>

+ This bug was cloned from Bugzilla Bug #1061130 +

45c6ee622f7a290e9c211eb1420ce362 (712 Bytes) 45c6ee622f7a290e9c211eb1420ce362 mhrivnak, 02/28/2015 11:01 PM

History

#1 Updated by mhrivnak almost 7 years ago

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.

+ This comment was cloned from Bugzilla #1061130 comment 1 +

#2 Updated by mhrivnak almost 7 years ago

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

+ This comment was cloned from Bugzilla #1061130 comment 2 +

#3 Updated by pthomas@redhat.com almost 7 years ago

verified
[root@cloud-qe-4 ~]# rpm -qa pulp-server
pulp-server-2.6.0-0.5.beta.el7.noarch
[root@cloud-qe-4 ~]#

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

+ This comment was cloned from Bugzilla #1061130 comment 3 +

#4 Updated by bmbouter almost 7 years ago

  • Severity changed from Medium to 2. Medium

#5 Updated by rbarlow over 6 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#7 Updated by bmbouter almost 3 years ago

  • Tags Pulp 2 added

#8 Updated by bmbouter over 1 year ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Also available in: Atom PDF