V3 token fails with KeyError 'expires'

Bug #1161633 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
Fix Released
High
Brant Knudson
tempest
Fix Released
Undecided
Brant Knudson

Bug Description

If I get a token using the V3 API and then pass that token to nova, it fails with a 401 error.

A valid token generated using the V3 API shoud work with nova.

The stack trace in n-api looks like this:

2013-03-28 17:06:32 DEBUG [keystoneclient.middleware.auth_token] Token validation failure.
Traceback (most recent call last):
  File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 693, in _validate_user_token
    self._cache_put(token_id, data)
  File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 937, in _cache_put
    timestamp = data['token']['expires']
KeyError: 'expires'

I'm using devstack and have not changed the config.

Here's the command to get a token:

curl -i \
 -d '
{
"auth": {
    "identity": {
        "methods": [ "password" ],
        "password": {
            "user": {
                "name": "admin", "password": "mypassword",
                "domain": { "id": "default" }
              }
          }
      },
    "scope": {
        "project": {
            "domain": { "id": "default" },
            "name": "admin"
          }
      }
  }
}' \
 -H "Content-Type: application/json" \
 http://localhost:35357/v3/auth/tokens

Then I pass it on to nova (I get the token ID from the header, and put it in TOKEN_V3=).

curl \
 -H "X-Auth-Token: $TOKEN_V3" \
 http://localhost:8774/v2/46ef56389b264799b5f4f9539ac4267f/servers/detail

I also tried with a V2 token, which works.

Brant Knudson (blk-u)
Changed in keystone:
status: New → Incomplete
Revision history for this message
Brant Knudson (blk-u) wrote :

I didn't find a review in openstack either... maybe the problem is the token format and not the auth_token middleware?

Revision history for this message
Brant Knudson (blk-u) wrote :
Revision history for this message
Brant Knudson (blk-u) wrote :

The Jenkins failure for the tempest testcase shows the error, see http://logs.openstack.org/25681/2/check/gate-tempest-devstack-vm-full/10955/logs/screen-n-api.txt.gz ,

2013-03-29 02:50:56 DEBUG [keystoneclient.middleware.auth_token] Token validation failure.
Traceback (most recent call last):
  File "/opt/stack/new/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 693, in _validate_user_token
    self._cache_put(token_id, data)
  File "/opt/stack/new/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 937, in _cache_put
    timestamp = data['token']['expires']
KeyError: 'expires'

Changed in keystone:
status: Incomplete → New
Brant Knudson (blk-u)
affects: keystone → python-keystoneclient
Revision history for this message
Brant Knudson (blk-u) wrote :
Changed in python-keystoneclient:
assignee: nobody → Brant Knudson (blk-u)
Changed in keystone:
assignee: nobody → Brant Knudson (blk-u)
Changed in tempest:
assignee: nobody → Brant Knudson (blk-u)
Brant Knudson (blk-u)
no longer affects: keystone
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/25761

Changed in python-keystoneclient:
status: New → In Progress
Changed in tempest:
status: New → In Progress
Brant Knudson (blk-u)
tags: added: grizzly-rc-potential
Thierry Carrez (ttx)
tags: removed: grizzly-rc-potential
Revision history for this message
Brant Knudson (blk-u) wrote :

was fixed with https://review.openstack.org/#/c/24192/ so abandoned the other change.

Rebased the tempest change which should pass now.

Changed in python-keystoneclient:
status: In Progress → Fix Committed
Dolph Mathews (dolph)
Changed in python-keystoneclient:
milestone: none → 0.2.4
importance: Undecided → High
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/25681
Committed: http://github.com/openstack/tempest/commit/c7ca3347f176df94ba7edd3e24e928fdea59ebac
Submitter: Jenkins
Branch: master

commit c7ca3347f176df94ba7edd3e24e928fdea59ebac
Author: Brant Knudson <email address hidden>
Date: Thu Mar 28 21:08:50 2013 -0500

    identity v3 token

    Adds a test where get a token using identity api v3,
    and use that to perform an operation using compute api.

    Fixes bug 1161633

    Change-Id: I5d8121d1734ec7f1991758360b829c7889540c71

Changed in tempest:
status: In Progress → Fix Released
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.