UnicodeDecodeError occurs when stack-create with non-exist keypair in non-english environment

Bug #1249224 reported by Chen Xiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Chen Xiao

Bug Description

in Japanese language environment:
not create the keypair "heat_key", then
execute "heat stack-create teststack -f WordPress_Single_Instance.template -P "instancetype=m1.test;DBUsername=wp;DBPassword=verybadpassword;KeyName=heat_key;LinuxDistribution=F17""

can see UnicodeDecodeError as follow

2013-11-05 02:20:15.867 15057 ERROR heat.engine.parser [-] [(')十十十十十十一構ソチ‐ The Key (heat_key) could not be found.]
2013-11-05 02:20:15.867 15057 TRACE heat.engine.parser Traceback (most recent call last):
2013-11-05 02:20:15.867 15057 TRACE heat.engine.parser File "/usr/lib/python2.6/site-packages/heat/engine/parser.py", line 308, in validate
2013-11-05 02:20:15.867 15057 TRACE heat.engine.parser result = res.validate()
2013-11-05 02:20:15.867 15057 TRACE heat.engine.parser File "/usr/lib/python2.6/site-packages/heat/engine/resources/instance.py", line 448, in validate
2013-11-05 02:20:15.867 15057 TRACE heat.engine.parser nova_utils.get_keypair(self.nova(), key_name)
2013-11-05 02:20:15.867 15057 TRACE heat.engine.parser File "/usr/lib/python2.6/site-packages/heat/engine/resources/nova_utils.py", line 122, in get_keypair
2013-11-05 02:20:15.867 15057 TRACE heat.engine.parser raise exception.UserKeyPairMissing(key_name=key_name)
2013-11-05 02:20:15.867 15057 TRACE heat.engine.parser UserKeyPairMissing: [(')十十十十十十一構ソチ‐ The Key (heat_key) could not be found.]
2013-11-05 02:20:15.867 15057 TRACE heat.engine.parser
2013-11-05 02:20:15.872 15057 ERROR heat.openstack.common.rpc.amqp [-] [(')十十十一構ソチ‐ Exception during message handling]
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp Traceback (most recent call last):
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.6/site-packages/heat/openstack/common/rpc/amqp.py", line 461, in _process_data
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp **args)
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.6/site-packages/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp result = getattr(proxyobj, method)(ctxt, **kwargs)
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.6/site-packages/heat/engine/service.py", line 60, in wrapped
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp return func(self, ctx, *args, **kwargs)
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.6/site-packages/heat/engine/service.py", line 273, in create_stack
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp stack.validate()
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.6/site-packages/heat/engine/parser.py", line 314, in validate
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp raise StackValidationFailed(message=str(ex))
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.6/site-packages/heat/common/exception.py", line 108, in __init__
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp self.message = self.message % kwargs
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.6/site-packages/heat/openstack/common/gettextutils.py", line 269, in __mod__
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp self.data % other
2013-11-05 02:20:15.872 15057 TRACE heat.openstack.common.rpc.amqp UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 4: ordinal not in range(128)

Chen Xiao (chenxiao)
Changed in heat:
assignee: nobody → Chen Xiao (chenxiao)
Changed in heat:
status: New → Triaged
importance: Undecided → Medium
milestone: none → icehouse-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: Triaged → In Progress
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/57182
Committed: http://github.com/openstack/heat/commit/1e4eb74a22c8939c688611a9dbd47fbf6ea9f21c
Submitter: Jenkins
Branch: master

commit 1e4eb74a22c8939c688611a9dbd47fbf6ea9f21c
Author: chenxiao <email address hidden>
Date: Tue Nov 19 18:04:41 2013 +0800

    Fix i18N compliance with non-existant keypair

    when test stack-create in Japanese language environment,
    execute "heat stack-create" with non-existant keypair
    "heat_key", UnicodeDecodeError will occur because
    exception message has not been decoded correctly for
    the following process:
    (_("%(message)s") % ('message': ...)).

    This patch uses safe_decode function in strutils module
    to resolve the error.

    Change-Id: I57cddae1b73a95cb9298daf51e49d5d7729467d9
    Closes-Bug: #1249224

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-1 → 2014.1
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.