Project

Profile

Help

Issue #394

closed

Wrong status code for Upload API

Added by igulina@redhat.com about 9 years ago. Updated almost 4 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
2.3
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Description of problem:

Import into a repository operation returns code 200 (aka if the import completed successfully), but response body repots an error.

Version-Release number of selected component (if applicable):
2.3

How reproducible:
always

Steps to Reproduce (first variant):
1. curl -i -H \"Accept: application/json\" -X POST -k -u admin:admin 'https://localhost/pulp/api/v2/content/uploads/'

HTTP/1.1 201 Created
Date: Mon, 03 Feb 2014 12:49:34 GMT
Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Location: /pulp/api/v2/content/uploads/b53ff383-8f97-4019-88e7-015af64d5f2f/
Content-Length: 132
Content-Type: application/json

{"upload_id": "b53ff383-8f97-4019-88e7-015af64d5f2f", "_href": "/pulp/api/v2/content/uploads/b53ff383-8f97-4019-88e7-015af64d5f2f/"}[igulina@localhost tests]$

2. curl -i -F name=test -F filedata=@/var/lib/pulp/content/rpm/whale/0.2/1/noarch/3b34234afc8b8931d627f8466f0e4fd352145a2512681ec29db0a051a0c9d893/whale-0.2-1.noarch.rpm -H \"Accept: application/json\" -X PUT -k -u admin:admin 'https://localhost/pulp/api/v2/content/uploads/b53ff383-8f97-4019-88e7-015af64d5f2f/500/'

HTTP/1.1 200 OK
Date: Mon, 03 Feb 2014 12:50:31 GMT
Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 4
Content-Type: application/json

3. curl -i -H \"Accept: application/json\" -X POST -k -u admin:admin -d '{"upload_id":"b53ff383-8f97-4019-88e7-015af64d5f2f","unit_type_id":"rpm", "unit_key" : "text.rpm"}' 'https://localhost/pulp/api/v2/repositories/foo/actions/import_upload/'

HTTP/1.1 200 OK
Date: Mon, 03 Feb 2014 12:58:05 GMT
Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 95
Content-Type: application/json

{"details": {"errors": ["invalid unit key or metadata"]}, "success_flag": false, "summary": ""}

Steps to Reproduce (second variant):
the same for uuid as "unit_key"

curl -i -H \"Accept: application/json\" -X POST -k -u admin:admin -d '{"upload_id":"b53ff383-8f97-4019-88e7-015af64d5f2f","unit_type_id":"rpm", "unit_key" : "fe28a235-d70a-4103-bb72-b89831d4cbc1"}' 'https://localhost/pulp/api/v2/repositories/foo/actions/import_upload/'

HTTP/1.1 200 OK
Date: Mon, 03 Feb 2014 13:44:07 GMT
Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 95
Content-Type: application/json

Expected results:
if "success_flag" is false then it should return error status code

HTTP/1.1 4xx Error

{"details": {"errors": ["invalid unit key or metadata"]}, "success_flag": false, "summary": ""}

Additional info:
Also see bug 1060752

+ This bug was cloned from Bugzilla Bug #1060757 +

Actions #1

Updated by mhrivnak about 9 years ago

***** Bug 1060759 has been marked as a duplicate of this bug. ***

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

Actions #2

Updated by amacdona@redhat.com about 9 years ago

  • Subject changed from Wrong status code to Wrong status code for Upload API
Actions #3

Updated by bmbouter about 5 years ago

  • Status changed from NEW to CLOSED - WONTFIX
Actions #4

Updated by bmbouter about 5 years ago

  • Severity set to 1. Low

Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.

Actions #5

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added
Actions #6

Updated by bmbouter almost 4 years ago

  • Category deleted (14)

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

Also available in: Atom PDF