Bug 1060757 - Wrong status code
Summary: Wrong status code
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: 2.3
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: pulp-qe-list
URL:
Whiteboard:
: 1060759 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-03 14:30 UTC by Irina Gulina
Modified: 2015-02-28 22:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:00:51 UTC
Embargoed:


Attachments (Terms of Use)


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

Description Irina Gulina 2014-02-03 14:30:13 UTC
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

Comment 1 Michael Hrivnak 2014-02-12 17:08:55 UTC
*** Bug 1060759 has been marked as a duplicate of this bug. ***

Comment 2 Brian Bouterse 2015-02-28 22:00:51 UTC
Moved to https://pulp.plan.io/issues/394


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