← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1212164] Re: when using memcache, nova host-list cause api exception

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1212164

Title:
  when using memcache, nova host-list cause api exception

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  nova host-list when using memcache

  2013-08-14 09:18:57.245 TRACE nova.api.openstack   File "/opt/stack/nova/nova/api/openstack/compute/contrib/hosts.py", line 143, in index
  2013-08-14 09:18:57.245 TRACE nova.api.openstack     set_zones=True)
  2013-08-14 09:18:57.245 TRACE nova.api.openstack   File "/opt/stack/nova/nova/compute/api.py", line 2900, in service_get_all
  2013-08-14 09:18:57.245 TRACE nova.api.openstack     services)
  2013-08-14 09:18:57.245 TRACE nova.api.openstack   File "/opt/stack/nova/nova/availability_zones.py", line 77, in set_availability_zones
  2013-08-14 09:18:57.245 TRACE nova.api.openstack     cache.delete(cache_key)
  2013-08-14 09:18:57.245 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/memcache.py", line 421, in delete
  2013-08-14 09:18:57.245 TRACE nova.api.openstack     self.check_key(key)
  2013-08-14 09:18:57.245 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/memcache.py", line 1014, in check_key
  2013-08-14 09:18:57.245 TRACE nova.api.openstack     "Keys must be str()'s, not unicode.  Convert your unicode "
  2013-08-14 09:18:57.245 TRACE nova.api.openstack MemcachedStringEncodingError: Keys must be str()'s, not unicode.  Convert your unicode strings using mystring.encode(charset)!
  2013-08-14 09:18:57.245 TRACE nova.api.openstack

  fix should be something like this

  diff --git a/nova/availability_zones.py b/nova/availability_zones.py
  index d627fa0..869ad87 100644
  --- a/nova/availability_zones.py
  +++ b/nova/availability_zones.py
  @@ -56,7 +56,7 @@ def _reset_cache():
   
   
   def _make_cache_key(host):
  -    return "azcache-%s" % host
  +    return "azcache-%s" % str(host)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1212164/+subscriptions