ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Masahiro Tanaka (JIRA)" <>
Subject [jira] [Created] (AMBARI-17245) Failed Hive metastore start due to UnicodeDecodeError
Date Wed, 15 Jun 2016 04:45:09 GMT
Masahiro Tanaka created AMBARI-17245:

             Summary: Failed Hive metastore start due to UnicodeDecodeError
                 Key: AMBARI-17245
             Project: Ambari
          Issue Type: Bug
          Components: ambari-server
    Affects Versions: trunk
         Environment: CentOS6.5, LANG=ja_JP.UTF-8
            Reporter: Masahiro Tanaka
            Assignee: Masahiro Tanaka

When we start hivemestore in the environment described above, we got an error

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HIVE/",
line 254, in <module>
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/",
line 257, in execute
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/",
line 686, in restart
    self.start(env, upgrade_type=upgrade_type)
  File "/var/lib/ambari-agent/cache/common-services/HIVE/",
line 61, in start
    hive_service('metastore', action='start', upgrade_type=upgrade_type)
  File "/usr/lib/python2.6/site-packages/ambari_commons/", line 89, in thunk
    return fn(*args, **kwargs)
  File "/var/lib/ambari-agent/cache/common-services/HIVE/",
line 70, in hive_service
    pid = get_user_call_output.get_user_call_output(format("cat {pid_file}"), user=params.hive_user,
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/",
line 59, in get_user_call_output
    err_msg = Logger.filter_text(("Execution of '%s' returned %d. %s") % (command_string,
code, all_output))
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 101, in
    text = text.replace(unprotected_string, protected_string)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 117: ordinal not in range(128)

I think the reason why this error occurs is because "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/".
This script calls system command (e.g. {{cat}}), writes stdout & stderr in the tempfile,
and read it. The outputs (stdout, stderr) are in UTF-8 encoded Japanese in the above environment.

When reading string from file, python regards the file as ASCII encoded by default. But if
the file is utf-8 encoded, this causes an error.

We should decode UTF-8 when reading the file.

This message was sent by Atlassian JIRA

View raw message