500 Error returned by Keystone server on passing invalid body for POST /tokens

Bug #1060709 reported by Rohit Karajgi
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
Unmesh Gurjar

Bug Description

Keystone returns a 500 Internal Server error for the following POST /v2.0/tokens request
with invalid body

1. Pass nothing in the body or pass a blank JSON dict {} -
Response ->
{
"error": {
"message": "An unexpected error prevented the server from fulfilling your request. argument of type 'NoneType' is not iterable",
"code": 500,
"title": "Internal Server Error"
}
}

2. Do not pass passwordCredentials in auth -- "auth": { }
Response-->
{
"error": {
"message": "An unexpected error prevented the server from fulfilling your request. local variable 'expiry' referenced before assignment",
"code": 500,
"title": "Internal Server Error"
}
}
The expected HTTP response in all the cases above should have been a 400 Bad Request.

Tags: ntt
Changed in keystone:
assignee: nobody → Unmesh Gurjar (unmesh-gurjar)
Tom Fifield (fifieldt)
Changed in keystone:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/14281

Changed in keystone:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/14281
Committed: http://github.com/openstack/keystone/commit/9ee3fba769274a84ea7709aa0068c19a421dbd80
Submitter: Jenkins
Branch: master

commit 9ee3fba769274a84ea7709aa0068c19a421dbd80
Author: Unmesh Gurjar <email address hidden>
Date: Wed Oct 10 04:22:31 2012 -0700

    Fixes 500 err on authentication for invalid body

    1. This fixes the 500 error on authentication when invalid request body is
    provided, a 400 Bad Request response is returned instead.
    2. Also added unit test coverage.

    Fixes LP: #1060709

    Change-Id: I7f2916e0b91de1e299d2dc7a245ff6c2bc548afd

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: grizzly-1 → 2013.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.