← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1316657] [NEW] 500 error in case request body is a valid json object, but not a dict

 

Public bug reported:

Any request to Keystone API, which contains a body, causes 500 error in
case this body is a valid JSON object, but not a dictionary.

For example, the next request:

    curl  -H"X-Auth-Token:ADMIN" -H "Content-type: application/json"
http://localhost:5000/v3/users -X GET -d "42"

produces the next response:

    HTTP/1.1 500 Internal Server Error
    Vary: X-Auth-Token
    Content-Type: application/json
    Content-Length: 185
    Date: Tue, 06 May 2014 15:16:29 GMT

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

and causes the next error message in the log:

2014-05-06 11:16:29.388 TRACE keystone.common.wsgi Traceback (most recent call last):
2014-05-06 11:16:29.388 TRACE keystone.common.wsgi   File "/opt/stack/keystone/keystone/common/wsgi.py", line 387, in __call__
2014-05-06 11:16:29.388 TRACE keystone.common.wsgi     response = self.process_request(request)
2014-05-06 11:16:29.388 TRACE keystone.common.wsgi   File "/opt/stack/keystone/keystone/middleware/core.py", line 135, in process_request
2014-05-06 11:16:29.388 TRACE keystone.common.wsgi     for k, v in six.iteritems(params_parsed):
2014-05-06 11:16:29.388 TRACE keystone.common.wsgi   File "/usr/local/lib/python2.7/dist-packages/six.py", line 498, in iteritems
2014-05-06 11:16:29.388 TRACE keystone.common.wsgi     return iter(getattr(d, _iteritems)(**kw))
2014-05-06 11:16:29.388 TRACE keystone.common.wsgi AttributeError: 'int' object has no attribute 'iteritems'

** Affects: keystone
     Importance: Undecided
         Status: New

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

Title:
  500 error in case request body is a valid json object, but not a dict

Status in OpenStack Identity (Keystone):
  New

Bug description:
  Any request to Keystone API, which contains a body, causes 500 error
  in case this body is a valid JSON object, but not a dictionary.

  For example, the next request:

      curl  -H"X-Auth-Token:ADMIN" -H "Content-type: application/json"
  http://localhost:5000/v3/users -X GET -d "42"

  produces the next response:

      HTTP/1.1 500 Internal Server Error
      Vary: X-Auth-Token
      Content-Type: application/json
      Content-Length: 185
      Date: Tue, 06 May 2014 15:16:29 GMT

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

  and causes the next error message in the log:

  2014-05-06 11:16:29.388 TRACE keystone.common.wsgi Traceback (most recent call last):
  2014-05-06 11:16:29.388 TRACE keystone.common.wsgi   File "/opt/stack/keystone/keystone/common/wsgi.py", line 387, in __call__
  2014-05-06 11:16:29.388 TRACE keystone.common.wsgi     response = self.process_request(request)
  2014-05-06 11:16:29.388 TRACE keystone.common.wsgi   File "/opt/stack/keystone/keystone/middleware/core.py", line 135, in process_request
  2014-05-06 11:16:29.388 TRACE keystone.common.wsgi     for k, v in six.iteritems(params_parsed):
  2014-05-06 11:16:29.388 TRACE keystone.common.wsgi   File "/usr/local/lib/python2.7/dist-packages/six.py", line 498, in iteritems
  2014-05-06 11:16:29.388 TRACE keystone.common.wsgi     return iter(getattr(d, _iteritems)(**kw))
  2014-05-06 11:16:29.388 TRACE keystone.common.wsgi AttributeError: 'int' object has no attribute 'iteritems'

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


Follow ups

References