Issue #394
closedWrong status code for Upload API
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 +
Updated by mhrivnak almost 10 years ago
***** Bug 1060759 has been marked as a duplicate of this bug. ***
+ This comment was cloned from Bugzilla #1060757 comment 1 +
Updated by amacdona@redhat.com almost 10 years ago
- Subject changed from Wrong status code to Wrong status code for Upload API
Updated by bmbouter almost 6 years ago
- Status changed from NEW to CLOSED - WONTFIX
Updated by bmbouter almost 6 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.
Updated by bmbouter over 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.