Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4EB0F200B29 for ; Wed, 15 Jun 2016 08:28:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4D712160A4C; Wed, 15 Jun 2016 06:28:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9BD0B160A4D for ; Wed, 15 Jun 2016 08:28:10 +0200 (CEST) Received: (qmail 59360 invoked by uid 500); 15 Jun 2016 06:28:09 -0000 Mailing-List: contact issues-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list issues@ambari.apache.org Received: (qmail 59330 invoked by uid 99); 15 Jun 2016 06:28:09 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2016 06:28:09 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 65AC12C1F5D for ; Wed, 15 Jun 2016 06:28:09 +0000 (UTC) Date: Wed, 15 Jun 2016 06:28:09 +0000 (UTC) From: "Masahiro Tanaka (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMBARI-17245) Failed to start Hive metastore due to UnicodeDecodeError MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 15 Jun 2016 06:28:11 -0000 [ https://issues.apache.org/jira/browse/AMBARI-17245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331227#comment-15331227 ] Masahiro Tanaka commented on AMBARI-17245: ------------------------------------------ Submit a patch > Failed to start Hive metastore due to UnicodeDecodeError > -------------------------------------------------------- > > Key: AMBARI-17245 > URL: https://issues.apache.org/jira/browse/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 > Attachments: AMBARI-17245.patch > > > When we start hivemestore in the environment described above, we got an error > {code} > Traceback (most recent call last): > File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py", line 254, in > HiveMetastore().execute() > File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 257, in execute > method(env) > File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 686, in restart > self.start(env, upgrade_type=upgrade_type) > File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py", line 61, in start > hive_service('metastore', action='start', upgrade_type=upgrade_type) > File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line 89, in thunk > return fn(*args, **kwargs) > File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py", line 70, in hive_service > pid = get_user_call_output.get_user_call_output(format("cat {pid_file}"), user=params.hive_user, is_checked_call=False)[1] > File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/get_user_call_output.py", 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/logger.py", line 101, in filter_text > text = text.replace(unprotected_string, protected_string) > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 117: ordinal not in range(128) > {code} > I think the reason why this error occurs is because "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/get_user_call_output.py". 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 (v6.3.4#6332)