'Provider' object has no attribute 'revoke_api'

Bug #1315049 reported by Udi Kalifon
This bug report is a duplicate of:  Bug #1294994: Managers instantiated multiple times. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
In Progress
Medium
werner mendizabal
Icehouse
In Progress
Medium
Dolph Mathews

Bug Description

In token/provider.py, the following triggers an exception if revoke_api is not loaded

        if self.revoke_api is not None:
            ....

The fix is to set self.revoke_api to None in the init:

    def __init__(self):
        super(Manager, self).__init__(self.get_token_provider())
        self.revoke_api = None

To recreate this, run the test_auth.py unit test:
nosetests test_auth.py

======================================================================
ERROR: keystone.tests.test_auth.TokenExpirationTest.test_maintain_uuid_token_expiration
----------------------------------------------------------------------
_StringException: pythonlogging:'': {{{
Adding cache-proxy 'keystone.tests.test_cache.CacheIsolatingProxy' to backend.
KVS region configuration for token-driver: {'keystone.kvs.arguments.distributed_lock': True, 'keystone.kvs.backend': 'openstack.kvs.Memory', 'keystone.kvs.arguments.lock_timeout': 6}
Using default dogpile sha1_mangle_key as KVS region token-driver key_mangler
It is recommended to only use the base key-value-store implementation for the token driver for testing purposes. Please use keystone.token.backends.memcache.Token or keystone.token.backends.sql.Token instead.
found extension EntryPoint.parse('qpid = oslo.messaging._drivers.impl_qpid:QpidDriver')
found extension EntryPoint.parse('zmq = oslo.messaging._drivers.impl_zmq:ZmqDriver')
found extension EntryPoint.parse('kombu = oslo.messaging._drivers.impl_rabbit:RabbitDriver')
found extension EntryPoint.parse('rabbit = oslo.messaging._drivers.impl_rabbit:RabbitDriver')
found extension EntryPoint.parse('fake = oslo.messaging._drivers.impl_fake:FakeDriver')
found extension EntryPoint.parse('cinder.openstack.common.notifier.no_op_notifier = oslo.messaging.notify._impl_noop:NoOpDriver')
found extension EntryPoint.parse('cinder.openstack.common.notifier.log_notifier = oslo.messaging.notify._impl_log:LogDriver')
found extension EntryPoint.parse('cinder.openstack.common.notifier.test_notifier = oslo.messaging.notify._impl_test:TestDriver')
found extension EntryPoint.parse('cinder.openstack.common.notifier.rpc_notifier2 = oslo.messaging.notify._impl_messaging:MessagingV2Driver')
found extension EntryPoint.parse('cinder.openstack.common.notifier.rpc_notifier = oslo.messaging.notify._impl_messaging:MessagingDriver')
found extension EntryPoint.parse('nova.openstack.common.notifier.no_op_notifier = oslo.messaging.notify._impl_noop:NoOpDriver')
found extension EntryPoint.parse('nova.openstack.common.notifier.test_notifier = oslo.messaging.notify._impl_test:TestDriver')
found extension EntryPoint.parse('nova.openstack.common.notifier.rpc_notifier = oslo.messaging.notify._impl_messaging:MessagingDriver')
found extension EntryPoint.parse('nova.openstack.common.notifier.log_notifier = oslo.messaging.notify._impl_log:LogDriver')
found extension EntryPoint.parse('nova.openstack.common.notifier.rpc_notifier2 = oslo.messaging.notify._impl_messaging:MessagingV2Driver')
found extension EntryPoint.parse('log = oslo.messaging.notify._impl_log:LogDriver')
found extension EntryPoint.parse('messagingv2 = oslo.messaging.notify._impl_messaging:MessagingV2Driver')
found extension EntryPoint.parse('noop = oslo.messaging.notify._impl_noop:NoOpDriver')
found extension EntryPoint.parse('routing = oslo.messaging.notify._impl_routing:RoutingDriver')
found extension EntryPoint.parse('test = oslo.messaging.notify._impl_test:TestDriver')
found extension EntryPoint.parse('messaging = oslo.messaging.notify._impl_messaging:MessagingDriver')
CADF Event: {'typeURI': 'http://schemas.dmtf.org/cloud/audit/1.0/event', 'initiator': {'typeURI': 'service/security/account/user', 'host': {}, 'id': 'openstack:01fefc8a-3fe9-4c44-b862-43d6f6ca171a', 'name': 'foo'}, 'target': {'typeURI': 'service/security/account/user', 'id': 'openstack:35588d31-1d48-467c-86fc-e9c5e5d360c3'}, 'observer': {'typeURI': 'service/security', 'id': 'openstack:fb2003ab-096c-4314-bb01-abb51acd5220'}, 'eventType': 'activity', 'eventTime': '2014-05-01T12:00:06.363039+0000', 'action': 'authenticate', 'outcome': 'pending', 'id': 'openstack:097f6616-4e38-486c-a39e-2f5c071c9b34'}
CADF Event: {'typeURI': 'http://schemas.dmtf.org/cloud/audit/1.0/event', 'initiator': {'typeURI': 'service/security/account/user', 'host': {}, 'id': 'openstack:01fefc8a-3fe9-4c44-b862-43d6f6ca171a', 'name': 'foo'}, 'target': {'typeURI': 'service/security/account/user', 'id': 'openstack:0ce4487f-dbcb-447c-9dd4-d3f364fb4244'}, 'observer': {'typeURI': 'service/security', 'id': 'openstack:53821d40-623d-4500-9552-09e6d87b0b4c'}, 'eventType': 'activity', 'eventTime': '2014-05-01T12:00:06.401262+0000', 'action': 'authenticate', 'outcome': 'success', 'id': 'openstack:9082f9a5-4e84-466c-a50f-a46a8230be09'}
Parsed 2014-05-01T13:00:06Z into {'tz_sign': None, 'second_fraction': None, 'hour': '13', 'daydash': '01', 'tz_hour': None, 'month': None, 'timezone': 'Z', 'second': '06', 'tz_minute': None, 'year': '2014', 'separator': 'T', 'monthdash': '05', 'day': None, 'minute': '00'} with default timezone <iso8601.iso8601.Utc object at 0x1b53590>
Got '2014' for 'year' with default None
Got '05' for 'monthdash' with default 1
Got 5 for 'month' with default 5
Got '01' for 'daydash' with default 1
Got 1 for 'day' with default 1
Got '13' for 'hour' with default None
Got '00' for 'minute' with default None
Got '06' for 'second' with default None
KVS lock acquired for: usertokens-foo
KVS lock released for: usertokens-foo
RBAC: Bypassing authorization
NeedRegenerationException
no value, waiting for create lock
value creation lock <dogpile.cache.region._LockWrapper object at 0x3ad3ed0> acquired
Calling creation function
Released creation lock
}}}

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/keystone/tests/test_auth.py", line 974, in test_maintain_uuid_token_expiration
    self._maintain_token_expiration()
  File "/usr/lib/python2.7/site-packages/mock.py", line 1201, in patched
    return func(*args, **keywargs)
  File "/usr/lib/python2.7/site-packages/keystone/tests/test_auth.py", line 949, in _maintain_token_expiration
    token_id=unscoped_token_id)
  File "/usr/lib/python2.7/site-packages/keystone/common/controller.py", line 152, in inner
    return f(self, context, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystone/token/controllers.py", line 412, in validate_token
    return self.token_provider_api.validate_v2_token(token_id, belongs_to)
  File "/usr/lib/python2.7/site-packages/keystone/token/provider.py", line 137, in validate_v2_token
    self.check_revocation_v2(token)
  File "/usr/lib/python2.7/site-packages/keystone/token/provider.py", line 127, in check_revocation_v2
    if self.revoke_api is not None:
  File "/usr/lib/python2.7/site-packages/keystone/common/manager.py", line 74, in __getattr__
    f = getattr(self.driver, name)
AttributeError: 'Provider' object has no attribute 'revoke_api'

Dolph Mathews (dolph)
tags: added: icehouse-backport-potential
Revision history for this message
Dolph Mathews (dolph) wrote :

This doesn't appear to be an issue in master (demonstrated below), but IS reproducible on stable/icehouse. Is this reproducible outside of tests?

$ nosetests keystone.tests.test_auth
............................................................
----------------------------------------------------------------------
Ran 60 tests in 28.505s

OK

Changed in keystone:
importance: Undecided → Low
status: New → Confirmed
status: Confirmed → Invalid
Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

This is likely due to the @optional decorator doing something wonky.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
assignee: nobody → werner mendizabal (nonameentername)
status: Invalid → In Progress
Revision history for this message
Lance Bragstad (lbragstad) wrote :

This is pretty close in review, so tagging with hopes of making it in RC1.

Changed in keystone:
milestone: none → juno-rc1
Dolph Mathews (dolph)
Changed in keystone:
importance: Low → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/120886

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (master)

Change abandoned by werner mendizabal (<email address hidden>) on branch: master
Review: https://review.openstack.org/116374
Reason: This is fixed in master

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (stable/icehouse)

Change abandoned by Dolph Mathews (<email address hidden>) on branch: stable/icehouse
Review: https://review.openstack.org/120886
Reason: backported the above patch in https://review.openstack.org/#/c/120924/

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.