Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-20148

"Set Version on All Hosts" Fails For Hosts Without Any Stack Components

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.5.0
    • 2.5.0
    • ambari-server
    • None

    Description

      During EU of HDP from 2.5.3.0 to 2.6.0.0, "Set Version on All Hosts" step failed for all hosts which don't have "versionable" components on them.

      stdout

      * 2017-02-21 23:55:38,889 - Task. Type: EXECUTE, Script: scripts/ru_set_all.py - Function: actionexecute
      * 2017-02-21 23:55:39,048 - call[('/usr/bin/yum', 'clean', 'all')] {'sudo': True}
      * 2017-02-21 23:55:39,328 - call returned (0, 'Loaded plugins: fastestmirror, security\nCleaning repos: HDP-2.5 HDP-UTILS-1.1.0.21 ambari-2.5.0.0 base extras updates\nCleaning up Everything\nCleaning up list of fastest mirrors')
      * 2017-02-21 23:55:39,329 - call[('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'all', '2.6.0.0-517')] {'sudo': True}
      * 2017-02-21 23:55:39,356 - call returned (1, 'ERROR: Invalid version 2.6.0.0-517\n\nValid choices:')
      * Traceback (most recent call last):
      *   File "/var/lib/ambari-agent/cache/custom_actions/scripts/ru_set_all.py", line 189, in <module>
      *     UpgradeSetAll().execute()
      *   File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 313, in execute
      *     method(env)
      *   File "/var/lib/ambari-agent/cache/custom_actions/scripts/ru_set_all.py", line 65, in actionexecute
      *     raise Exception("Command '{0}' exit code is nonzero".format(cmd))
      * Exception: Command '('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'all', '2.6.0.0-517')' exit code is nonzero
      
      * Command failed after 1 tries
      

      stderr

      * Traceback (most recent call last):
      *   File "/var/lib/ambari-agent/cache/custom_actions/scripts/ru_execute_tasks.py", line 156, in <module>
      *     ExecuteUpgradeTasks().execute()
      *   File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 313, in execute
      *     method(env)
      *   File "/var/lib/ambari-agent/cache/custom_actions/scripts/ru_execute_tasks.py", line 153, in actionexecute
      *     shell.checked_call(task.command, logoutput=True, quiet=True)
      *   File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 72, in inner
      *     result = function(command, **kwargs)
      *   File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 102, in checked_call
      *     tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy)
      *   File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 150, in _call_wrapper
      *     result = _call(command, **kwargs_copy)
      *   File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 303, in _call
      *     raise ExecutionFailed(err_msg, code, out, err)
      * resource_management.core.exceptions.ExecutionFailed: Execution of 'source /var/lib/ambari-agent/ambari-env.sh ; /usr/bin/ambari-python-wrap /var/lib/ambari-agent/cache/custom_actions/scripts/ru_set_all.py actionexecute /var/lib/ambari-agent/data/command-71697.json /var/lib/ambari-agent/cache/custom_actions /var/lib/ambari-agent/data/structured-out-71697.json INFO /var/lib/ambari-agent/tmp' returned 1. 2017-02-21 23:55:39,048 - call[('/usr/bin/yum', 'clean', 'all')] {'sudo': True}
      * 2017-02-21 23:55:39,328 - call returned (0, 'Loaded plugins: fastestmirror, security\nCleaning repos: HDP-2.5 HDP-UTILS-1.1.0.21 ambari-2.5.0.0 base extras updates\nCleaning up Everything\nCleaning up list of fastest mirrors')
      * 2017-02-21 23:55:39,329 - call[('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'all', '2.6.0.0-517')] {'sudo': True}
      * 2017-02-21 23:55:39,356 - call returned (1, 'ERROR: Invalid version 2.6.0.0-517\n\nValid choices:')
      * Traceback (most recent call last):
      *   File "/var/lib/ambari-agent/cache/custom_actions/scripts/ru_set_all.py", line 189, in <module>
      *     UpgradeSetAll().execute()
      *   File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 313, in execute
      *     method(env)
      *   File "/var/lib/ambari-agent/cache/custom_actions/scripts/ru_set_all.py", line 65, in actionexecute
      *     raise Exception("Command '{0}' exit code is nonzero".format(cmd))
      * Exception: Command '('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'all', '2.6.0.0-517')' exit code is nonzero
      

      hdp-select exists on this hosts, but since there's no stack installed, it can fail in two different ways:

      [root@c6402 ~]# hdp-select versions
      Traceback (most recent call last):
        File "/usr/bin/hdp-select", line 395, in <module>
          printVersions()
        File "/usr/bin/hdp-select", line 240, in printVersions
          for f in os.listdir(root):
      OSError: [Errno 2] No such file or directory: '/usr/hdp'
      [root@c6402 ~]# echo $?
      1
      
      [root@c6402 ~]# hdp-select versions
      [root@c6402 ~]# echo $?
      0
      

      Attachments

        1. AMBARI-20148.patch
          9 kB
          Jonathan Hurley

        Issue Links

          Activity

            People

              jonathanhurley Jonathan Hurley
              jonathanhurley Jonathan Hurley
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: