Hide Forgot
Description of problem: Version-Release number of selected component (if applicable): rpm -qa pulp-server pulp-server-2.4.0-0.20.beta.el6.noarch How reproducible: always Steps to Reproduce: >>curl -k -X GET https://admin:admin@localhost/pulp/api/v2/events/ [] >> curl -k -X GET https://admin:admin@localhost/pulp/api/v2/events/53a2efa1b7e943519470c186/ {"http_request_method": "GET", "exception": null, "error_message": "Missing resource(s): event_listener=53a2efa1b7e943519470c186", "_href": "/pulp/api/v2/events/53a2efa1b7e943519470c186/", "http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"event_listener": "53a2efa1b7e943519470c186"}}, "description": "Missing resource(s): event_listener=53a2efa1b7e943519470c186", "sub_errors": []}, "traceback": null, "resources": {"event_listener": "53a2efa1b7e943519470c186"}} Expected results: HTTP/1.1 404 Not Found Date: Thu, 19 Jun 2014 14:30:34 GMT Server: Apache/2.2.15 (Red Hat) Content-Length: 9 Connection: close Content-Type: text/html; charset=UTF-8 not found
This is returning a 404. It is returning more data in addition to the 404 but the HTTP error code is being returned properly.
I've untriaged this after a discussion with Barnaby. We aren't terribly consistent about what we return when a 404 occurs, so we need to decide what the correct response is and be consistent with that decision. Below are two possible results for a 404. This is the output for a missing event listener: curl -i -H "Accept: application/json" -X GET -u admin:admin -k 'https://localhost/pulp/api/v2/events/notanevent/' HTTP/1.1 404 Not Found Date: Thu, 07 Aug 2014 13:10:17 GMT Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5 Content-Encoding: utf-8 Content-Length: 416 Content-Type: application/json { "_href": "/pulp/api/v2/events/notanevent/", "error": { "code": "PLP0009", "data": { "resources": { "event_listener": "notanevent" } }, "description": "Missing resource(s): event_listener=notanevent", "sub_errors": [] }, "error_message": "Missing resource(s): event_listener=notanevent", "exception": null, "http_request_method": "GET", "http_status": 404, "resources": { "event_listener": "notanevent" }, "traceback": null } This is the same output you'll see from /pulp/api/v2/repositories/notarepository/ or /pulp/api/v2/consumers/notaconsumer/ This is the output from retrieving the schedules for a consumer that doesn't exist: curl -i -H "Accept: application/json" -X GET -u admin:admin -k 'https://localhost/pulp/api/v2/consumers/notaconsumer/schedules/' HTTP/1.1 404 Not Found Date: Thu, 07 Aug 2014 15:43:54 GMT Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5 Content-Length: 9 Content-Type: text/html; charset=UTF-8 not found
Moved to https://pulp.plan.io/issues/457