Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1A29D174DB for ; Sat, 7 Feb 2015 01:16:35 +0000 (UTC) Received: (qmail 33073 invoked by uid 500); 7 Feb 2015 01:16:35 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 33047 invoked by uid 500); 7 Feb 2015 01:16:34 -0000 Mailing-List: contact dev-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 dev@ambari.apache.org Received: (qmail 32841 invoked by uid 99); 7 Feb 2015 01:16:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Feb 2015 01:16:34 +0000 Date: Sat, 7 Feb 2015 01:16:34 +0000 (UTC) From: "Alejandro Fernandez (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMBARI-9507) RU - Prepare Namenode fails on Ubuntu12 due to path error with import MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-9507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alejandro Fernandez updated AMBARI-9507: ---------------------------------------- Attachment: AMBARI-9507.patch > RU - Prepare Namenode fails on Ubuntu12 due to path error with import > --------------------------------------------------------------------- > > Key: AMBARI-9507 > URL: https://issues.apache.org/jira/browse/AMBARI-9507 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Affects Versions: 2.0.0 > Reporter: Alejandro Fernandez > Assignee: Alejandro Fernandez > Fix For: 2.0.0 > > Attachments: AMBARI-9507.patch > > > Prepare namenode failed during RU on Ubuntu12, retry does not help. > This is because ru_execute_task.py calls python directly, instead of the python wrapper that appends several other directories to the PYTHONPATH environment variable, which is needed by the module imports. > {code} > 2015-02-03 03:11:47,374 - Task. Type: EXECUTE, Script: scripts/namenode.py - Function: prepare_rolling_upgrade > 2015-02-03 03:11:47,395 - call['python /var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py prepare_rolling_upgrade /var/lib/ambari-agent/data/command-274.json /var/lib/ambari-agent/cache/custom_actions /var/lib/ambari-agent/data/structured-out-274.json INFO /var/lib/ambari-agent/data/tmp'] {} > 2015-02-03 03:11:47,451 - Command: python /var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py prepare_rolling_upgrade /var/lib/ambari-agent/data/command-274.json /var/lib/ambari-agent/cache/custom_actions /var/lib/ambari-agent/data/structured-out-274.json INFO /var/lib/ambari-agent/data/tmp > Code: 1, Out: Traceback (most recent call last): > File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py", line 24, in > from resource_management import * > ImportError: No module named resource_management > 2015-02-03 03:11:47,452 - Error while executing command 'actionexecute': > Traceback (most recent call last): > File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 184, in execute > method(env) > File "/var/lib/ambari-agent/cache/custom_actions/scripts/ru_execute_tasks.py", line 146, in actionexecute > raise Fail(out) > Fail: Traceback (most recent call last): > File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py", line 24, in > from resource_management import * > ImportError: No module named resource_management > {code} > Compare centos6 to ubuntu12 VM. > {code} > *Centos 6* > Uses python2.6 > Sys.path: > /var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts > /usr/lib64/python26.zip > /usr/lib64/python2.6 > /usr/lib64/python2.6/plat-linux2 > /usr/lib64/python2.6/lib-tk > /usr/lib64/python2.6/lib-old > /usr/lib64/python2.6/lib-dynload > /usr/lib64/python2.6/site-packages > /usr/lib/python2.6/site-packages (inside this there are symlinks) > Contains symlink and folder > ls -la /usr/lib/python2.6/site-packages/resource_management > /usr/lib/python2.6/site-packages/resource_management -> /usr/lib/ambari-agent/lib/resource_management > *Ubuntu 12* > Uses python 2.7 > Sys.path: > /var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts > /usr/lib/python2.7 > /usr/lib/python2.7/plat-linux2 > /usr/lib/python2.7/lib-tk > /usr/lib/python2.7/lib-old > /usr/lib/python2.7/lib-dynload > /usr/local/lib/python2.7/dist-packages > /usr/lib/python2.7/dist-packages > Contains folders: > /usr/lib/ambari-agent/lib/resource_management/ > /usr/lib/ambari-server/lib/resource_management/ > {code} > Our ambari-agent setup script calls, export PYTHONPATH=/usr/lib/python2.6/site-packages:$PYTHONPATH > So this has no effect on Ubuntu. > install-helper.sh has, > {code} > RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management" > ... > if [ ! -d "$RESOURCE_MANAGEMENT_DIR" ]; then > ln -s "$RESOURCE_MANAGEMENT_DIR_AGENT" "$RESOURCE_MANAGEMENT_DIR" > fi > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)