Missing 'content-type' header triggers 500 Internal Server Error

Bug #1012282 reported by Rafael Durán Castañeda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Dolph Mathews

Bug Description

Hi,

After fresh Devstack install I've tried get a new token, forgetting add the 'content-type' header and resulting on a 500 Internal Server Error:

curl -X POST 192.168.27.100:5000/v2.0/tokens -d '{"auth": {"tenantName": "demo", "passwordCredentials": {"username": "demo", "password": "secrete"}}}'

{"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"}}

After adding the header everything works as expected:

curl -X POST 192.168.27.100:5000/v2.0/tokens -d '{"auth": {"tenantName": "demo", "passwordCredentials": {"username": "demo", "password": "secrete"}}}' -H "content-type: application/json"

{"access": {"token": {"expires": "2012-06-13T17:23:02Z", "id": "2aad440e21ed47dcbae9c8123161665d", "tenant": {"enabled": true, "id": "12242928b55c4d02b2604ca13fb272d5", "name": "demo", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.27.100:8774/v2/12242928b55c4d02b2604ca13fb272d5", "region": "RegionOne", "publicURL": "http://192.168.27.100:8774/v2/12242928b55c4d02b2604ca13fb272d5", "internalURL": "http://192.168.27.100:8774/v2/12242928b55c4d02b2604ca13fb272d5"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.27.100:3333", "region": "RegionOne", "publicURL": "http://192.168.27.100:3333", "internalURL": "http://192.168.27.100:3333"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.27.100:9292", "region": "RegionOne", "publicURL": "http://192.168.27.100:9292", "internalURL": "http://192.168.27.100:9292"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.27.100:8776/v1/12242928b55c4d02b2604ca13fb272d5", "region": "RegionOne", "publicURL": "http://192.168.27.100:8776/v1/12242928b55c4d02b2604ca13fb272d5", "internalURL": "http://192.168.27.100:8776/v1/12242928b55c4d02b2604ca13fb272d5"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.27.100:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.27.100:8773/services/Cloud", "internalURL": "http://192.168.27.100:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.27.100:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.27.100:5000/v2.0", "internalURL": "http://192.168.27.100:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "demo", "roles_links": [], "id": "85673f58d7f54f84ac788776f81a094a", "roles": [{"id": "71e1b82f2bc24db7834747dbe42ac811", "name": "Member"}, {"id": "df9f5612961d49a7bb3e5d6e5837ff29", "name": "anotherrole"}], "name": "demo"}}}

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/8563

Changed in keystone:
assignee: nobody → Dolph Mathews (dolph)
status: New → In Progress
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/8563
Committed: http://github.com/openstack/keystone/commit/489c6b60d115af1416d48f058b86d78ff15ca787
Submitter: Jenkins
Branch: master

commit 489c6b60d115af1416d48f058b86d78ff15ca787
Author: Dolph Mathews <email address hidden>
Date: Thu Jun 14 13:47:06 2012 -0500

    400 on unrecognized content type (bug 1012282)

    Unrecognized content type:
      http://paste.openstack.org/raw/18537/

    Malformed JSON:
      http://paste.openstack.org/raw/18536/

    Change-Id: I76afbf9300bcb1c11bed74eddbe4972c451c5877

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