Type errors when using Keystone middleware

Bug #907949 reported by Adam Gandelman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
New
Undecided
Unassigned
swift (Ubuntu)
New
Undecided
Unassigned

Bug Description

When configuring swift-proxy to use keystone middleware, I get the following traceback:

# curl -k -v -H 'X-Auth-Token: 2017744172225' https://ip-10-252-14-88.us-west-2.compute.internal:8080/v1/AUTH_1
...snip...
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain
< Content-Length: 957
< Date: Thu, 22 Dec 2011 23:25:05 GMT
< Connection: close
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/swift/common/middleware/healthcheck.py", line 38, in __call__
    return self.app(env, start_response)
  File "/usr/lib/python2.7/dist-packages/swift/common/middleware/memcache.py", line 32, in __call__
    return self.app(env, start_response)
  File "/usr/lib/python2.7/dist-packages/keystone/middleware/auth_token.py", line 270, in __call__
    claims = self._verify_claims(env, token)
  File "/usr/lib/python2.7/dist-packages/keystone/middleware/auth_token.py", line 399, in _verify_claims
    cached_claims = self._cache_get(env, claims)
  File "/usr/lib/python2.7/dist-packages/keystone/middleware/auth_token.py", line 366, in _cache_get
    if expires > datetime.now():
TypeError: can't compare datetime.datetime to float
* Closing connection #0

Using datetime.fromtimestamp(expires) in _cache_put() + _cache_get() to properly convert seems to work around the problem, but I'm not sure this is the solution as 'expires' ends up a proper datetime here when nova is using this middleware. Nova, however, has a similar issue around the keys ( see Bug #907945 ). I'm not sure if this is a bug in the middleware itself or each respective projects' use of the API.

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.