AttributeError is not caught when creating a role with bad request

Bug #1287471 reported by Haiwei Xu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
In Progress
Low
Haiwei Xu

Bug Description

When I directly use the 'curl' command to create a new role with a valid body, I got a server error(500).

curl -i -X POST http://10.21.42.98:35357/v2.0/OS-KSADM/roles -H "User-Aghon-keystoneclient" -H "Content-Type: application/json" -H "X-Auth-Token: MIIPawYJKoZIhvcNAQcCoIIPXDCCD1gCAQExCTAHBgUrDgMCGjCCDcEGCSqGSIb3DQEHAaCCDbIEgg2ueyJhY2Nlc3MiOiB7InaT
......
KzfH3T6aXNeUzyngMfPa0iCly2o4vfnq3XkJTbBwtATRrUS3+VS102SzGJXb17Uu42cLLW2rFP7aSl0-ioRe" -d '{"role": ""}'

HTTP/1.1 500 Internal Server Error
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 189
Date: Tue, 04 Mar 2014 10:59:10 GMT

{"error": {"message": "An unexpected error prevented the server from fulfilling your request. 'unicode' object has no attribute 'iteritems'", "code": 500, "title": "Internal Server Error"}}

And the log in the keystone service.

2014-03-04 19:59:10.973 ERROR keystone.common.wsgi [-] 'unicode' object has no attribute 'iteritems'
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi Traceback (most recent call last):
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi File "/opt/stack/keystone/keystone/common/wsgi.py", line 211, in __call__
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi result = method(context, **params)
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi File "/opt/stack/keystone/keystone/openstack/common/versionutils.py", line 102, in wrapped
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi return func(*args, **kwargs)
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi File "/opt/stack/keystone/keystone/assignment/controllers.py", line 215, in create_role
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi role = self._normalize_dict(role)
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi File "/opt/stack/keystone/keystone/common/wsgi.py", line 254, in _normalize_dict
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi for (k, v) in six.iteritems(d)])
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi File "/usr/local/lib/python2.7/dist-packages/six.py", line 439, in iteritems
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi return iter(getattr(d, _iteritems)(**kw))
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi AttributeError: 'unicode' object has no attribute 'iteritems'
2014-03-04 19:59:10.973 TRACE keystone.common.wsgi

The AttributeError is not caught.

Haiwei Xu (xu-haiwei)
Changed in keystone:
assignee: nobody → Haiwei Xu (xu-haiwei)
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/77757

Changed in keystone:
status: New → In Progress
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Low
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.