memcache_use_advanced_pool = True doesn't work when use oslo.cache

Bug #1748160 reported by wangxiyuan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystonemiddleware
Fix Released
Undecided
wangxiyuan

Bug Description

Env: keystonemiddleware master, oslo.cache master

now keystonemiddleware use oslo.cache for memcache pool.
But when set memcache_use_advanced_pool = True for the service, an error will happen.

use Cinde for example, Error Log:

  [None req-fb207801-3c94-4ecf-a493-fefdf5158c2f None None] Caught error: <type 'exceptions.TypeError'> __init__() takes exactly 3 arguments (2 given): TypeErro
  Traceback (most recent call last):
    File "/opt/stack/cinder/cinder/api/middleware/fault.py", line 85, in __call__
      return req.get_response(self.application)
    File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1327, in send
      application, catch_exc_info=False)
    File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1291, in call_application
      app_iter = application(self.environ, start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 145, in __call__
      return resp(environ, start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 131, in __call__
      resp = self.call_func(req, *args, **self.kwargs)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 196, in call_func
      return self.func(req, *args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/osprofiler/web.py", line 108, in __call__
      return request.get_response(self.application)
    File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1327, in send
      application, catch_exc_info=False)
    File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1291, in call_application
      app_iter = application(self.environ, start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 131, in __call__
      resp = self.call_func(req, *args, **self.kwargs)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 196, in call_func
      return self.func(req, *args, **kwargs)
    File "/opt/stack/keystonemiddleware/keystonemiddleware/auth_token/__init__.py", line 334, in __call__
      response = self.process_request(req)
    File "/opt/stack/keystonemiddleware/keystonemiddleware/auth_token/__init__.py", line 631, in process_request
      self._token_cache.initialize(request.environ)
    File "/opt/stack/keystonemiddleware/keystonemiddleware/auth_token/_cache.py", line 149, in initialize
      self._cache_pool = self._get_cache_pool(env.get(self._env_cache_name))
    File "/opt/stack/keystonemiddleware/keystonemiddleware/auth_token/_cache.py", line 140, in _get_cache_pool
      **self._memcache_pool_options)
    File "/opt/stack/keystonemiddleware/keystonemiddleware/auth_token/_cache.py", line 96, in __init__
      **kwargs)
  TypeError: __init__() takes exactly 3 arguments (2 given)

How to reproduce:
1. install the newest keystonemiddleware and oslo.cache
2. set memcache_use_advanced_pool = True in cinder.conf in [keystone_auth] section.
3. restart Cinder
4. print command "cinder list"

Expect: cinder will return the volume list
Actual: cinder raise 500 error, the error log is mentioned above.

wangxiyuan (wangxiyuan)
Changed in keystonemiddleware:
assignee: nobody → wangxiyuan (wangxiyuan)
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/542133

Changed in keystonemiddleware:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystonemiddleware (master)

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

commit ce06c0ce1035964ecf117bd56f769174508dc269
Author: wangxiyuan <email address hidden>
Date: Thu Feb 8 17:19:28 2018 +0800

    Add arguments for MemcacheClientPool init

    Now keystonemiddleware use oslo.cache to init the
    MemcacheClientPool. The MemcacheClientPool in
    Olso.cache needs (urls, arguments, **kwargs) parameter
    to init, but keystonemiddleware passed only
    (urls, **kwargs). Then it leads the error:
    __init__() takes exactly 3 arguments (2 given)

    This patch fixed this issue.

    Please note that even this error is fixed, set
    "memcache_use_advanced_pool = True" will lead another
    error, see bug #1747565 for the detail. It will be
    fixed in the following patch.

    Closes-bug: #1748160
    Change-Id: I642f959ab8b010207314312a6b6a06a6de23e92c

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

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

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/583684

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

Reviewed: https://review.openstack.org/583684
Committed: https://git.openstack.org/cgit/openstack/keystonemiddleware/commit/?id=c21f7f43eef21f4b78273058b86fc5b9005f1d93
Submitter: Zuul
Branch: stable/queens

commit c21f7f43eef21f4b78273058b86fc5b9005f1d93
Author: wangxiyuan <email address hidden>
Date: Thu Feb 8 17:19:28 2018 +0800

    Add arguments for MemcacheClientPool init

    Now keystonemiddleware use oslo.cache to init the
    MemcacheClientPool. The MemcacheClientPool in
    Olso.cache needs (urls, arguments, **kwargs) parameter
    to init, but keystonemiddleware passed only
    (urls, **kwargs). Then it leads the error:
    __init__() takes exactly 3 arguments (2 given)

    This patch fixed this issue.

    Please note that even this error is fixed, set
    "memcache_use_advanced_pool = True" will lead another
    error, see bug #1747565 for the detail. It will be
    fixed in the following patch.

    Conflicts:
     keystonemiddleware/tests/unit/auth_token/test_cache.py

    Closes-bug: #1748160
    Change-Id: I642f959ab8b010207314312a6b6a06a6de23e92c
    (cherry picked from commit ce06c0ce1035964ecf117bd56f769174508dc269)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystonemiddleware 4.22.0

This issue was fixed in the openstack/keystonemiddleware 4.22.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.