OSAPI: Create server 500 error when malformed bodies

Bug #816128 reported by Alex Meade
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Brian Waldon

Bug Description

Currently, fault handling when performing create server requests with a malformed body is often incorrect.
These should be returning 400s or 422s instead of 500s and have useful error messages.

This may encompass or be related to numerous bugs such as bug 797250 and bug 798969

using the following command with different bodies results in many different 500 errors:

curl -X POST -H "Content-Type: application/json" -d '{"server": {"name": "cow"}}' -v -H "Accept: application/xml" -H "X-Auth-Token: ${NOVA_TOKEN}" http://localhost:8774/v1.1/servers

{"server": {"name": "cow"}}

results in:
<cloudServersFault code="500" xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
    <message>
        'imageRef'
    </message>
</cloudServersFault>

{"server":"kjdslkfj"}

results in:
<cloudServersFault code="500" xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
    <message>
        'unicode' object has no attribute 'get'
    </message>
</cloudServersFault>

Tags: osapi-v1.1

Related branches

Revision history for this message
Thierry Carrez (ttx) wrote :

Related to bug 816601

Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Brian Waldon (bcwaldon)
tags: added: osapi-v1.1
Revision history for this message
Brian Waldon (bcwaldon) wrote :

The first case above is not reproducible, but the second was. I'm going to close this bug after the attached branch goes in, and we can add more specific bugs in the future if anything like this comes up.

Changed in nova:
status: Confirmed → In Progress
assignee: nobody → Brian Waldon (bcwaldon)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-1 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.