Volumes APIs returns a 500 error for an invalid entity body rather than 422
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Medium
|
Mark McLoughlin | ||
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Mark McLoughlin |
Bug Description
Description:
------------------
When Request body is sent as "Invalid JSON" request, HTTP 500 ERROR is returned instead of Bad Request exception(code :400).
Environment:
-----------------
Single node Folsom
Consider the following examples
LOG:
----------
1. Server Creation with invalid JSON
rajalakshmi_
HTTP/1.1 500 Internal Server Error
Content-Length: 128
Content-Type: application/json; charset=UTF-8
X-Compute-
Date: Mon, 10 Sep 2012 15:03:28 GMT
{"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}rajalakshm
2. Volume Creation with invalid JSON
rajalakshmi_
HTTP/1.1 500 Internal Server Error
Content-Length: 128
Content-Type: application/json; charset=UTF-8
X-Compute-
Date: Mon, 10 Sep 2012 15:09:37 GMT
{"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}rajalakshm
3. Attaching VOLUME to SERVER with invalid JSON
rajalakshmi_
HTTP/1.1 500 Internal Server Error
Content-Length: 128
Content-Type: application/json; charset=UTF-8
X-Compute-
Date: Mon, 10 Sep 2012 15:08:35 GMT
{"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}rajalakshm
Changed in nova: | |
importance: | Undecided → High |
status: | New → Triaged |
milestone: | none → folsom-rc1 |
Changed in nova: | |
importance: | High → Medium |
Changed in nova: | |
assignee: | nobody → Mark McLoughlin (markmc) |
Changed in cinder: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in cinder: | |
milestone: | folsom-rc1 → 2012.2 |
Changed in nova: | |
milestone: | folsom-rc1 → 2012.2 |
I'm not able to reproduce this. Can you share the logs of the relevant 500s?
vagrant@precise:~$ curl -d '{"erver": {"min_count": 1, "flavorRef": "1", "name": "test-3", "imageRef": "bc81d48e- 656f-4501- 8909-3401121cdf 5b", "max_count": 1}}' -H 'content-type: application/json' -i -X POST -H 'x-auth-token: 9a344bf6c1f2456 bb66595603a0c77 7f' http:// localhost: 8774/v2/ 2dc7470e18614d5 4a960289c2bafae 3b/servers
HTTP/1.1 422 Unprocessable Entity Request- Id: req-a10e9102- a54a-462f- aa70-f5331371d7 06
Content-Length: 90
Content-Type: application/json; charset=UTF-8
X-Compute-
Date: Tue, 11 Sep 2012 21:43:28 GMT
{"computeFault": {"message": "Unable to process the contained instructions", "code": 422}}