Python "RemoteError: Remote error: UnicodeEncodeError 'ascii' codec can't encode ch:报错
{
"traceback": " File \"/opt/stackstorm/st2/lib/python2.7/site-packages/st2actions/container/base.py\", line 99, in _do_run\n LOG.debug('Performing run for runner: %s' % (runner.runner_id), extra=extra)\n File \"/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py\", line 49, in wrapped_f\n def wrapped_f(*args, **kw):\n File \"/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py\", line 206, in call\n if not self.should_reject(attempt):\n File \"/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py\", line 247, in get\n else:\n File \"/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py\", line 200, in call\n try:\n File \"/opt/stackstorm/runners/mistral_v2/mistral_v2.py\", line 219, in run\n result = self.start(action_parameters=action_parameters)\n File \"/opt/stackstorm/runners/mistral_v2/mistral_v2.py\", line 256, in start\n **options)\n File \"/opt/stackstorm/st2/lib/python2.7/site-packages/mistralclient/api/v2/executions.py\", line 56, in create\n return self._create('/executions', data)\n File \"/opt/stackstorm/st2/lib/python2.7/site-packages/mistralclient/api/base.py\", line 95, in _create\n self._raise_api_exception(resp)\n File \"/opt/stackstorm/st2/lib/python2.7/site-packages/mistralclient/api/base.py\", line 143, in _raise_api_exception\n error_message=error_data)\n",
"error": "RemoteError: Remote error: UnicodeEncodeError 'ascii' codec can't encode character u'\\xae' in position 169: ordinal not in range(128)\n[u'Traceback (most recent call last):\\n', u' File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/oslo_messaging/rpc/server.py\", line 155, in _process_incoming\\n failure = None\\n', u' File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py\", line 222, in dispatch\\n if hasattr(endpoint, method):\\n', u' File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py\", line 192, in _do_dispatch\\n new_args[argname] = self.serializer.deserialize_entity(ctxt, arg)\\n', u' File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/mistral/engine/engine_server.py\", line 98, in start_workflow\\n (rpc_ctx, workflow_identifier, utils.cut(workflow_input),\\n', u' File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/mistral/utils/__init__.py\", line 284, in cut\\n return cut_dict(data, length=length)\\n', u' File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/mistral/utils/__init__.py\", line 198, in cut_dict\\n v = str(value)\\n', u\"UnicodeEncodeError: 'ascii' codec can't encode character u'\\\\xae' in position 169: ordinal not in range(128)\\n\"]."
}
# encoding=utf8
import sys reload(sys) sys.setdefaultencoding("utf8")
尝试了以上的方式,仍然无效。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。