ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Onischuk (JIRA)" <>
Subject [jira] [Created] (AMBARI-18162) Tracebacks of exceptions should always be available
Date Tue, 16 Aug 2016 14:50:20 GMT
Andrew Onischuk created AMBARI-18162:

             Summary: Tracebacks of exceptions should always be available
                 Key: AMBARI-18162
             Project: Ambari
          Issue Type: Bug
            Reporter: Andrew Onischuk
            Assignee: Andrew Onischuk
             Fix For: 3.0.0
         Attachments: AMBARI-18162.patch

We have a bunch of places similar to this (especially in python RU code):

        dfsadmin_base_command = get_dfsadmin_base_command(hdfs_binary)
        command = dfsadmin_base_command + ' -report -live'
        return_code, hdfs_output =, user=params.hdfs_user)
        raise Fail('Unable to determine if the DataNode has started after upgrade.')

Where the actual valuable information is just masked by re-raising exception
and saying "something went wrong sorry". This makes issues very problematic to
debug, especially on other users side, where it's often hard to receive any

The solution would be to make Fail exception class to print the causing
exception. Similar to what is done by default in Python3.


    Traceback (most recent call last):
      File "/var/lib/ambari-agent/cache/common-services/YARN/",
line 150, in service_check
        Execute("hive mkdir /a")
      File "/usr/lib/python2.6/site-packages/resource_management/core/", line 155,
in __init__
      File "/usr/lib/python2.6/site-packages/resource_management/core/", line
160, in run
        self.run_action(resource, action)
      File "/usr/lib/python2.6/site-packages/resource_management/core/", line
124, in run_action
      File "/usr/lib/python2.6/site-packages/resource_management/core/providers/",
line 273, in action_run
        tries=self.resource.tries, try_sleep=self.resource.try_sleep)
      File "/usr/lib/python2.6/site-packages/resource_management/core/", line 71,
in inner
        result = function(command, **kwargs)
      File "/usr/lib/python2.6/site-packages/resource_management/core/", line 93,
in checked_call
        tries=tries, try_sleep=try_sleep)
      File "/usr/lib/python2.6/site-packages/resource_management/core/", line 141,
in _call_wrapper
        result = _call(command, **kwargs_copy)
      File "/usr/lib/python2.6/site-packages/resource_management/core/", line 294,
in _call
        raise Fail(err_msg)
    Fail: Execution of 'hive mkdir /a' returned 127. /bin/bash: hive: command not found
    The above exception was the direct cause of the following exception:
    Traceback (most recent call last):
      File "/var/lib/ambari-agent/cache/common-services/YARN/",
line 164, in <module>
      File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/",
line 280, in execute
      File "/var/lib/ambari-agent/cache/common-services/YARN/",
line 152, in service_check
        raise Fail(format("Something went wrong"))
    resource_management.core.exceptions.Fail: Something went wrong

This message was sent by Atlassian JIRA

View raw message