AttributeError when use memcache_use_advanced_pool = True in Ocata

Bug #1747565 reported by Shuo Liu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
keystonemiddleware
Fix Released
Undecided
wangxiyuan

Bug Description

nova.conf:
[keystone_authtoken]
auth_uri = http://100.2.30.156:5000
auth_url = http://100.2.30.156:35357
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = vwvAd5W56PWNiA7spQKThLdWUHbs8toPV381NEfd
memcache_security_strategy = ENCRYPT
memcache_secret_key = ZMlqIsY0JVueQJI0StN9FtAGQy3Jrl0xueXo0WCB
memcached_servers = 100.2.30.156:11211
memcache_use_advanced_pool = True

log:
     return self.func(req, *args, **kwargs)
   File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 332, in __call__
     response = self.process_request(req)
   File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 623, in process_request
     resp = super(AuthProtocol, self).process_request(request)
   File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 405, in process_request
     allow_expired=allow_expired)
   File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 435, in _do_fetch_token
     data = self.fetch_token(token, **kwargs)
   File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 737, in fetch_token
     cached = self._cache_get_hashes(token_hashes)
   File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 720, in _cache_get_hashes
     cached = self._token_cache.get(token)
   File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py", line 214, in get
     with self._cache_pool.reserve() as cache:
   File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
     return self.gen.next()
   File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py", line 98, in reserve
     with self._pool.get() as client:
 AttributeError: __exit__

Revision history for this message
wangxiyuan (wangxiyuan) wrote :

which version do you use for keystonemiddleware?

wangxiyuan (wangxiyuan)
Changed in keystonemiddleware:
assignee: nobody → wangxiyuan (wangxiyuan)
Revision history for this message
wangxiyuan (wangxiyuan) wrote :

I can reproduce this error after fixing the bug https://bugs.launchpad.net/keystonemiddleware/+bug/1748160

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

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

Changed in keystonemiddleware:
status: New → In Progress
Revision history for this message
Shuo Liu (liushuobj) wrote :

I found this problem in Ocata version that codes are very different from Q or later

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

Reviewed: https://review.openstack.org/542134
Committed: https://git.openstack.org/cgit/openstack/keystonemiddleware/commit/?id=33a712bed791a94df2824fb1ace1a5c3f58342c1
Submitter: Zuul
Branch: master

commit 33a712bed791a94df2824fb1ace1a5c3f58342c1
Author: wangxiyuan <email address hidden>
Date: Thu Feb 8 19:04:36 2018 +0800

    Fix the AttributeError: __exit__ error

    The memcache client class actually has no __exit__ function.

    Remove the "with" usage to avoid the __exit__ error.

    Change-Id: I15b3d08f4afae289e7eb0848ff1db08141196d3c
    Closes-Bug: #1747565

Changed in keystonemiddleware:
status: In Progress → Fix Released
Revision history for this message
wangxiyuan (wangxiyuan) wrote :

@Shuo Liu it's fixed now, but it's not easy to backport to O since the code is changed a lot. Can you take a look and fix it privately?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystonemiddleware 5.0.0

This issue was fixed in the openstack/keystonemiddleware 5.0.0 release.

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.