-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41037/
-----------------------------------------------------------
Review request for Ambari and Vitalyi Brodetskyi.
Bugs: AMBARI-14247
https://issues.apache.org/jira/browse/AMBARI-14247
Repository: ambari
Description
-------
This happens because we parse output of a sudo command. And if any warning or
error output happened during parsing of sudoers or during work of sudo binary.
We will fail.
For me this was caused by temporary network failure:
root@gu1207:/usr/lib/python2.6/site-packages/resource_management/core# sudo
echo
sudo: waring: unable to resolve host gu1207
1 2 3
But can happen due to any other output from sudo.
Stack trace:
Traceback (most recent call last):
File
"/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py",
line 35, in <module>
BeforeAnyHook().execute()
File
"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
line 217, in execute
method(env)
File
"/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py",
line 31, in hook
setup_hadoop_env()
File
"/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py",
line 142, in setup_hadoop_env
Directory(params.hadoop_dir, mode=0755)
File "/usr/lib/python2.6/site-packages/resource_management/core/base.py",
line 154, in __init__
self.env.run()
File
"/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
line 158, in run
self.run_action(resource, action)
File
"/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
line 121, in run_action
provider_action()
File
"/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py",
line 164, in action_create
mode=self.resource.mode, cd_access=self.resource.cd_access)
File
"/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py",
line 60, in _ensure_metadata
stat = sudo.stat(path)
File "/usr/lib/python2.6/site-packages/resource_management/core/sudo.py",
line 216, in stat
return Stat(path)
File "/usr/lib/python2.6/site-packages/resource_management/core/sudo.py",
line 213, in __init__
uid_str, gid_str, mode_str = out.split(' ')
ValueError: too many values to unpack
Error: Error: Unable to run the custom hook script ['/usr/bin/python2',
'/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py',
'ANY', '/var/lib/ambari-agent/data/command-157.json',
'/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY',
'/var/lib/ambari-agent/data/structured-out-157.json', 'INFO',
'/var/lib/ambari-agent/tmp']
Diffs
-----
ambari-common/src/main/python/resource_management/core/sudo.py 1a83ec5
Diff: https://reviews.apache.org/r/41037/diff/
Testing
-------
mvn clean test
Thanks,
Andrew Onischuk