← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1174487] Re: Nova API memcached key encoding error

 

** Changed in: nova/grizzly
       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/1174487

Title:
  Nova API memcached key encoding error

Status in OpenStack Compute (Nova):
  Fix Committed
Status in OpenStack Compute (nova) grizzly series:
  Fix Released

Bug description:
  Memcached requires strings, not unicode to be passed as the key. The
  following error is seen when attempting to use memcached with Grizzly
  2013.1.1.

  2013-04-23 13:56:52.883 INFO nova.virt.libvirt.driver [req-97b9d0e8-77c4-4d22-9f9c-d028497e6db6 cc295ce252b24080a83a46a974aaa417 5b5b73caffc04791a04ce86c919b0
  efa] [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] Creating image
  2013-04-23 13:56:53.039 INFO nova.virt.libvirt.driver [req-97b9d0e8-77c4-4d22-9f9c-d028497e6db6 cc295ce252b24080a83a46a974aaa417 5b5b73caffc04791a04ce86c919b0
  efa] [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] Using config drive
  2013-04-23 13:56:53.166 ERROR nova.compute.manager [req-97b9d0e8-77c4-4d22-9f9c-d028497e6db6 cc295ce252b24080a83a46a974aaa417 5b5b73caffc04791a04ce86c919b0efa
  ] [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] Instance failed to spawn
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] Traceback (most recent call last):
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/comput
  e/manager.py", line 1089, in _spawn
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     block_device_info)
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/virt/l
  ibvirt/driver.py", line 1517, in spawn
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     admin_pass=admin_password)
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/virt/l
  ibvirt/driver.py", line 1858, in _create_image
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     content=files, extra_md=extra_md)
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/api/me
  tadata/base.py", line 124, in __init__
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     self.ec2_ids = capi.get_ec2_ids(ctxt, instance)
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/conduc
  tor/api.py", line 674, in get_ec2_ids
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     return self.conductor_rpcapi.get_ec2_ids(context
  , instance)
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/conduc
  tor/rpcapi.py", line 434, in get_ec2_ids
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     return self.call(context, msg, version='1.42')
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/openst
  ack/common/rpc/proxy.py", line 80, in call
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     return rpc.call(context, self._get_topic(topic),
   msg, timeout)
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/openst
  ack/common/rpc/__init__.py", line 140, in call
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     return _get_impl().call(CONF, context, topic, ms
  g, timeout)
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/openst
  ack/common/rpc/impl_kombu.py", line 798, in call
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     rpc_amqp.get_connection_pool(conf, Connection))
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/openst
  ack/common/rpc/amqp.py", line 612, in call
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     rv = list(rv)
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]   File "/usr/lib/python2.7/dist-packages/nova/openst
  ack/common/rpc/amqp.py", line 561, in __iter__
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]     raise result
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] RemoteError: Remote error: MemcachedStringEncodingEr
  ror Keys must be str()'s, not unicode.  Convert your unicode strings using mystring.encode(charset)!
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] [u'Traceback (most recent call last):\n', u'  File "
  /usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py", line 430, in _process_data\n    rval = self.proxy.dispatch(ctxt, version, method, **args)
  \n', u'  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatcher.py", line 133, in dispatch\n    return getattr(proxyobj, method)(ctxt, **
  kwargs)\n', u'  File "/usr/lib/python2.7/dist-packages/nova/conductor/manager.py", line 410, in get_ec2_ids\n    ec2_ids[\'instance-id\'] = ec2utils.id_to_ec2
  _inst_id(instance[\'uuid\'])\n', u'  File "/usr/lib/python2.7/dist-packages/nova/api/ec2/ec2utils.py", line 161, in id_to_ec2_inst_id\n    int_id = get_int_id
  _from_instance_uuid(ctxt, instance_id)\n', u'  File "/usr/lib/python2.7/dist-packages/nova/api/ec2/ec2utils.py", line 45, in memoizer\n    value = _CACHE.get(
  key)\n', u'  File "/usr/lib/python2.7/dist-packages/memcache.py", line 862, in get\n    return self._get(\'get\', key)\n', u'  File "/usr/lib/python2.7/dist-p
  ackages/memcache.py", line 813, in _get\n    self.check_key(key)\n', u'  File "/usr/lib/python2.7/dist-packages/memcache.py", line 1014, in check_key\n    "Ke
  ys must be str()\'s, not unicode.  Convert your unicode "\n', u"MemcachedStringEncodingError: Keys must be str()'s, not unicode.  Convert your unicode strings
   using mystring.encode(charset)!\n"].
  2013-04-23 13:56:53.166 14035 TRACE nova.compute.manager [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0]
  2013-04-23 13:56:53.249 AUDIT nova.compute.manager [req-97b9d0e8-77c4-4d22-9f9c-d028497e6db6 cc295ce252b24080a83a46a974aaa417 5b5b73caffc04791a04ce86c919b0efa
  ] [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] Terminating instance
  2013-04-23 13:56:53.661 14035 ERROR nova.virt.libvirt.driver [-] [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] During wait destroy, instance disappeared.
  2013-04-23 13:56:53.663 INFO nova.virt.libvirt.driver [req-97b9d0e8-77c4-4d22-9f9c-d028497e6db6 cc295ce252b24080a83a46a974aaa417 5b5b73caffc04791a04ce86c919b0
  efa] [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] Deleting instance files /var/lib/nova/instances/b7fbc357-ad45-4c13-97a9-a72258b475f0
  2013-04-23 13:56:53.735 ERROR nova.compute.manager [req-97b9d0e8-77c4-4d22-9f9c-d028497e6db6 cc295ce252b24080a83a46a974aaa417 5b5b73caffc04791a04ce86c919b0efa
  ] [instance: b7fbc357-ad45-4c13-97a9-a72258b475f0] Error: ['Traceback (most recent call last):\n', '  File "/usr/lib/python2.7/dist-packages/nova/compute/mana
  ger.py", line 834, in _run_instance\n    set_access_ip=set_access_ip)\n', '  File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1093, in _s
  pawn\n    LOG.exception(_(\'Instance failed to spawn\'), instance=instance)\n', '  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__\n    self.gen
  .next()\n', '  File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1089, in _spawn\n    block_device_info)\n', '  File "/usr/lib/python2.7/d
  ist-packages/nova/virt/libvirt/driver.py", line 1517, in spawn\n    admin_pass=admin_password)\n', '  File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt
  /driver.py", line 1858, in _create_image\n    content=files, extra_md=extra_md)\n', '  File "/usr/lib/python2.7/dist-packages/nova/api/metadata/base.py", line
   124, in __init__\n    self.ec2_ids = capi.get_ec2_ids(ctxt, instance)\n', '  File "/usr/lib/python2.7/dist-packages/nova/conductor/api.py", line 674, in get_
  ec2_ids\n    return self.conductor_rpcapi.get_ec2_ids(context, instance)\n', '  File "/usr/lib/python2.7/dist-packages/nova/conductor/rpcapi.py", line 434, in
   get_ec2_ids\n    return self.call(context, msg, version=\'1.42\')\n', '  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/proxy.py", line 80,
   in call\n    return rpc.call(context, self._get_topic(topic), msg, timeout)\n', '  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/__init__.
  py", line 140, in call\n    return _get_impl().call(CONF, context, topic, msg, timeout)\n', '  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rp
  c/impl_kombu.py", line 798, in call\n    rpc_amqp.get_connection_pool(conf, Connection))\n', '  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/r
  pc/amqp.py", line 612, in call\n    rv = list(rv)\n', '  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py", line 561, in __iter__\n
   raise result\n', 'RemoteError: Remote error: MemcachedStringEncodingError Keys must be str()\'s, not unicode.  Convert your unicode strings using mystring.en
  code(charset)!\n[u\'Traceback (most recent call last):\\n\', u\'  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py", line 430, in _pro
  cess_data\\n    rval = self.proxy.dispatch(ctxt, version, method, **args)\\n\', u\'  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatch
  er.py", line 133, in dispatch\\n    return getattr(proxyobj, method)(ctxt, **kwargs)\\n\', u\'  File "/usr/lib/python2.7/dist-packages/nova/conductor/manager.
  py", line 410, in get_ec2_ids\\n    ec2_ids[\\\'instance-id\\\'] = ec2utils.id_to_ec2_inst_id(instance[\\\'uuid\\\'])\\n\', u\'  File "/usr/lib/python2.7/dist
  -packages/nova/api/ec2/ec2utils.py", line 161, in id_to_ec2_inst_id\\n    int_id = get_int_id_from_instance_uuid(ctxt, instance_id)\\n\', u\'  File "/usr/lib/
  python2.7/dist-packages/nova/api/ec2/ec2utils.py", line 45, in memoizer\\n    value = _CACHE.get(key)\\n\', u\'  File "/usr/lib/python2.7/dist-packages/memcac
  he.py", line 862, in get\\n    return self._get(\\\'get\\\', key)\\n\', u\'  File "/usr/lib/python2.7/dist-packages/memcache.py", line 813, in _get\\n    self
  .check_key(key)\\n\', u\'  File "/usr/lib/python2.7/dist-packages/memcache.py", line 1014, in check_key\\n    "Keys must be str()\\\'s, not unicode.  Convert
  your unicode "\\n\', u"MemcachedStringEncodingError: Keys must be str()\'s, not unicode.  Convert your unicode strings using mystring.encode(charset)!\\n"].\n
  ']

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