You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Andrew Onischuk (JIRA)" <ji...@apache.org> on 2015/12/07 14:54:10 UTC

[jira] [Created] (AMBARI-14247) Most tasks fail in non-root in case of advanced sudoers settings

Andrew Onischuk created AMBARI-14247:
----------------------------------------

             Summary: Most tasks fail in non-root in case of advanced sudoers settings
                 Key: AMBARI-14247
                 URL: https://issues.apache.org/jira/browse/AMBARI-14247
             Project: Ambari
          Issue Type: Bug
            Reporter: Andrew Onischuk
            Assignee: Andrew Onischuk
             Fix For: 2.2.0


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']
    





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)