← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1212778] Re: Authenticating v2 token against v3 api fails with error 500

 

** Changed in: keystone
       Status: Fix Committed => Fix Released

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

Title:
  Authenticating v2 token against v3 api fails with error 500

Status in OpenStack Identity (Keystone):
  Fix Released

Bug description:
  I've been trying to consume a trust as documented in:

  https://github.com/openstack/identity-api/blob/master/openstack-
  identity-api/v3/src/markdown/identity-api-v3-os-trust-ext.md

  Using my patch to keystoneclient:

  https://review.openstack.org/#/c/39899/

  And I find that although the request to v3/auth/tokens fails with the
  following error:

  REQ: curl -i -X POST http://localhost:35357/v3/auth/tokens -H "User-Agent: python-keystoneclient" -H "Content-Type: application/json" -H "X-Auth-Token: <ADMIN TOKEN>"
  REQ BODY: {"auth": {"identity": {"methods": ["token"], "token": {"id": <ADMIN TOKEN>}}, "scope": {"OS-TRUST:trust": {"id": "7b6d5a4ee39645e3aba11c535e5069f3"}}}}

  RESP: [500] {'date': 'Thu, 15 Aug 2013 17:18:08 GMT', 'content-type': 'application/json', 'content-length': '151', 'vary': 'X-Auth-Token'}
  RESP BODY: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. 'token'", "code": 500, "title": "Internal Server Error"}}

  Request returned failure status: 500
  Traceback (most recent call last):
    File "trust_reproducer.py", line 61, in <module>
      c_trust.authenticate()
    File "/opt/stack/python-keystoneclient/keystoneclient/httpclient.py", line 458, in authenticate
      resp, body = self.get_raw_token_from_identity_service(**kwargs)
    File "/opt/stack/python-keystoneclient/keystoneclient/v3/client.py", line 165, in get_raw_token_from_identity_service
      '%s' % e)
  keystoneclient.exceptions.AuthorizationFailure: Authorization failed: An unexpected error prevented the server from fulfilling your request. 'token' (HTTP 500)

  I've replaced the real token with <ADMIN TOKEN> above.

  In the keystone log output I see this:

  2013-08-15 18:36:57.129 4171 ERROR keystone.common.wsgi [-] 'token'
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi Traceback (most recent call last):
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi   File "/opt/stack/keystone/keystone/common/wsgi.py", line 240, in __call__
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi     result = method(context, **params)
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi   File "/opt/stack/keystone/keystone/auth/controllers.py", line 287, in authenticate_for_token
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi     self.authenticate(context, auth_info, auth_context)
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi   File "/opt/stack/keystone/keystone/auth/controllers.py", line 343, in authenticate
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi     auth_context)
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi   File "/opt/stack/keystone/keystone/auth/plugins/token.py", line 42, in authenticate
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi     'user_id', token_ref['token_data']['token']['user']['id'])
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi KeyError: 'token'
  2013-08-15 18:36:57.129 4171 TRACE keystone.common.wsgi 

  I'm at keystone git rev 14e090154c10001550127628c2728013f15d4256

  I've attached a reproducer I've been testing with (will require
  installing the keystoneclient patch mentioned above)

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