← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1287471] [NEW] AttributeError is not caught when creating a role with bad request

 

Public bug reported:

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.

** Affects: keystone
     Importance: Undecided
     Assignee: Haiwei Xu (xu-haiwei)
         Status: New

** Changed in: keystone
     Assignee: (unassigned) => Haiwei Xu (xu-haiwei)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1287471

Title:
  AttributeError is not caught when creating a role with bad request

Status in OpenStack Identity (Keystone):
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1287471/+subscriptions


Follow ups

References