[
https://issues.apache.org/jira/browse/AMBARI-9507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alejandro Fernandez updated AMBARI-9507:
----------------------------------------
Attachment: (was: 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 <module>
> 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 <module>
> 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)