OSAPI: Create server 500 error when malformed bodies

Bug #816128 reported by Alex Meade on 2011-07-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
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">


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

Related branches

Thierry Carrez (ttx) wrote :

Related to bug 816601

Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Brian Waldon (bcwaldon) on 2011-09-08
tags: added: osapi-v1.1
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) on 2011-11-09
Changed in nova:
milestone: none → essex-1
Thierry Carrez (ttx) on 2011-11-17
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-1 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers