1. Change OpenStack server to Russian locale, LANG=ru_RU.utf8
2. Set firefox client browser locale to russian(ru)
3. Trigger an operational failure that has a message that tries to get written to a Nova instance fault
Stacktrace
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 302, in decorated_function
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher pass
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 288, in decorated_function
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 330, in decorated_function
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher kwargs['instance'], e, sys.exc_info())
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/utils.py", line 94, in add_instance_fault_from_exc
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher fault_obj.create()
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/objects/base.py", line 204, in wrapper
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher return fn(self, ctxt, *args, **kwargs)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/objects/instance_fault.py", line 75, in create
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher db_fault = db.instance_fault_create(context, values)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/db/api.py", line 1816, in instance_fault_create
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher return IMPL.instance_fault_create(context, values)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/api.py", line 5423, in instance_fault_create
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher fault_ref.save()
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/models.py", line 62, in save
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher super(NovaBase, self).save(session=session)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/oslo/db/sqlalchemy/models.py", line 48, in save
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher session.flush()
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 1818, in flush
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher self._flush(objects)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 1936, in _flush
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher transaction.rollback(_capture_exception=True)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/util/langhelpers.py", line 58, in __exit__
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher compat.reraise(exc_type, exc_value, exc_tb)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 1900, in _flush
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher flush_context.execute()
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher rec.execute(self)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/unitofwork.py", line 525, in execute
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher uow
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/persistence.py", line 64, in save_obj
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher table, insert)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/persistence.py", line 569, in _emit_insert_statements
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher execute(statement, params)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 662, in execute
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher params)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher compiled_sql, distilled_params
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher context)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/oslo/db/sqlalchemy/compat/handle_error.py", line 125, in _handle_dbapi_exception
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher six.reraise(type(newraise), newraise, sys.exc_info()[2])
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/oslo/db/sqlalchemy/compat/handle_error.py", line 102, in _handle_dbapi_exception
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher per_fn = fn(ctx)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/oslo/db/sqlalchemy/exc_filters.py", line 323, in handler
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher context.is_disconnect)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/oslo/db/sqlalchemy/exc_filters.py", line 278, in _raise_for_remaining_DBAPIError
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher raise exception.DBError(error)
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher DBError: (DataError) ibm_db_dbi::DataError: Sending data failed: [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001 SQLCODE=-99999 'INSERT INTO instance_faults (deleted_at, deleted, created_at, updated_at, instance_uuid, code, message, details, host) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)' (None, 0, datetime.datetime(2014, 10, 30, 9, 55, 34, 42767), None, '1b73ce51-e2b2-4704-ab4a-1c2178e6b0b1', 500, 'NV-918894F \xd0\x92\xd0\xb8\xd1\x80\xd1\x82\xd1\x83\xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbd\xd0\xb0\xd1\x8f \xd0\xbc\xd0\xb0\xd1\x88\xd0\xb8\xd0\xbd\xd0\xb0 Image_rhel65_-1b73ce51-00000001 \xd1\x80\xd0\xb0\xd0\xb1\xd0\xbe\xd1\x82\xd0\xb0\xd0\xbb\xd0\xb0 \xd0\xb2 \xd0\xbc\xd0\xbe\xd0\xbc\xd0\xb5\xd0\xbd\xd1\x82 \xd1\x81\xd0\xbe\xd0\xb7\xd0\xb4\xd0\xb0\xd0\xbd\xd0\xb8\xd1\x8f \xd0\xbc\xd0\xbe\xd0\xbc\xd0\xb5\xd0\xbd\xd1\x82\xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbd\xd0\xbe\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xbf\xd0\xb8\xd0\xb8. \xd0\x92\xd0\xb8\xd1\x80\xd1\x82\xd1\x83\xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbd\xd1\x8b\xd0\xb5 \xd0\xbc\xd0\xb0\xd1\x88\xd0\xb8\xd0\xbd\xd1\x8b \xd0\xb4\xd0\xbe\xd0\xbb\xd0\xb6\xd0\xbd\xd1\x8b \xd0\xb1\xd1\x8b\xd1\x82\xd1\x8c \xd0\xbe\xd1\x81\xd1\x82\xd0\xb0\xd0\xbd\xd0\xbe\xd0\xb2\xd0\xbb\xd0\xb5\xd0\xbd\xd1\x8b \xd0\xbf\xd0\xb5\xd1\x80\xd0\xb5\xd0\xb4 \xd1\x81\xd0\xbe\xd0\xb7\xd0\xb4\xd0\xb0\xd0\xbd\xd0\xb8\xd0\xb5\xd0\xbc \xd0\xbc\xd0\xbe\xd0\xbc\xd0\xb5\xd0\xbd\xd1\x82\xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbd\xd0\xbe\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xbf\xd0\xb8\xd0\xb8.', ' File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 318, in decorated_function\n return function(self, context, *args, **kwargs)\n File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 378, in decorated_function\n instance=instance)\n File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 368, in decorated_function\n *args, **kwargs)\n File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 3071, in snapshot_instance\n task_states.IMAGE_SNAPSHOT)\n File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 3106, in _snapshot_instance\n update_task_state)\n File "/usr/lib/python2.6/site-packages/powervc_nova/__init__.py", line 96, in wrapper\n r = f(*args, **kwds)\n File "/usr/lib/python2.6/site-packages/powervc_nova/virt/ibmpowervm/hmc/driver.py", line 683, in snapshot\n image.capture(context, host, instance, image_entry, update_task_state)\n File "/usr/lib/python2.6/site-packages/powervc_nova/__init__.py", line 96, in wrapper\n r = f(*args, **kwds)\n File "/usr/lib/python2.6/site-packages/powervc_nova/virt/ibmpowervm/hmc/image.py", line 280, in capture\n e)\n File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n File "/usr/lib/python2.6/site-packages/powervc_nova/virt/ibmpowervm/hmc/image.py", line 260, in capture\n self._wait_for_instance_to_stop(instance, host)\n File "/usr/lib/python2.6/site-packages/powervc_nova/__init__.py", line 96, in wrapper\n r = f(*args, **kwds)\n File "/usr/lib/python2.6/site-packages/powervc_nova/virt/ibmpowervm/hmc/image.py", line 339, in _wait_for_instance_to_stop\n instance_name=instance[\'name\'])\n', '828421A_TU00156')
2014-10-30 05:55:34.933 18371 TRACE oslo.messaging.rpc.dispatcher
The code in nova/compute/ utils.py function exception_to_dict, is already trimming the message to 255 characters but it is doing this on the unicode string. The string must be trimmed to 255 characters in an encoded manner to avoid this issue for non-English locales.