Pivotal Knowledge Base

Follow

Ambari fails start/stop services with error "UnicodeDecodeError"

Environment

  • PHD 3.0.0.0
  • Amabari 1.7.1

Symptom

Starting the namenode through ambari fails with the following error. But the actual namenode service start operation is successful

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/PHD/2.0.6/services/HDFS/package/scripts/namenode.py", line 134, in 
    NameNode().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 123, in execute
    method(env)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 233, in restart
    self.start(env)
  File "/var/lib/ambari-agent/cache/stacks/PHD/2.0.6/services/HDFS/package/scripts/namenode.py", line 46, in start
    namenode(action="start")
  File "/var/lib/ambari-agent/cache/stacks/PHD/2.0.6/services/HDFS/package/scripts/hdfs_namenode.py", line 60, in namenode
    only_if=dfs_check_nn_status_cmd #skip when HA not active
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 148, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 149, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 115, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 237, in action_run
    path=self.resource.path)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 36, in checked_call
    return _call(command, logoutput, True, cwd, env, preexec_fn, user, wait_for_finish, timeout, path)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 101, in _call
    err_msg = Logger.get_protected_text((u"Execution of '%s' returned %d. %s".encode("utf8")) % (command, code, out))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 144: ordinal not in range(128)

Cause

Customer local was changed to zh_CN.UTF-8

[root@namenode1 ~]# more /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
[root@namenode1 ~]#
[root@namenode1 ~]# locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=

Fix

This is a known issue reported in AMBARI-5693. The workaround for this issue is to simply change the local setting to "en_US.UTF-8" on the ambari server host.

 

Comments

Powered by Zendesk