Return-Path: X-Original-To: apmail-incubator-ambari-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3C0610ACC for ; Mon, 21 Oct 2013 10:34:47 +0000 (UTC) Received: (qmail 7535 invoked by uid 500); 21 Oct 2013 10:34:45 -0000 Delivered-To: apmail-incubator-ambari-dev-archive@incubator.apache.org Received: (qmail 7446 invoked by uid 500); 21 Oct 2013 10:34:44 -0000 Mailing-List: contact ambari-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-dev@incubator.apache.org Received: (qmail 7422 invoked by uid 99); 21 Oct 2013 10:34:42 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Oct 2013 10:34:42 +0000 Date: Mon, 21 Oct 2013 10:34:42 +0000 (UTC) From: "Andrew Onischuk (JIRA)" To: ambari-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMBARI-3558) Resource Manager. On resource fail should give actual error messages, not just exceptions and Enable passing lists to Execute() to fix the user escape errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-3558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13800532#comment-13800532 ] Andrew Onischuk commented on AMBARI-3558: ----------------------------------------- Now the code looks like this: {code} Traceback (most recent call last): File "/root/workspace/tests/tests/test1.py", line 22, in main() File "/root/workspace/tests/tests/test1.py", line 19, in main env.run() File "/usr/lib/python2.6/site-packages/resource_management/environment.py", line 117, in run self.run_action(resource, action) File "/usr/lib/python2.6/site-packages/resource_management/environment.py", line 78, in run_action provider_action() File "/usr/lib/python2.6/site-packages/resource_management/providers/service.py", line 11, in action_start self._exec_cmd("start", 0) File "/usr/lib/python2.6/site-packages/resource_management/providers/service.py", line 57, in _exec_cmd self, command, self.resource.service_name, ret, out)) resource_management.exceptions.Fail: ServiceProvider[Service['iptables']] command start for service iptables failed with return code: 127. {code} also now we can forget about espcaping sttrings in shell commands problem, since this patch enables passing a tuple of arguments right to popen {code} Execute(('rm','-rf','test.txt'), ...) {code} > Resource Manager. On resource fail should give actual error messages, not just exceptions and Enable passing lists to Execute() to fix the user escape errors > -------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: AMBARI-3558 > URL: https://issues.apache.org/jira/browse/AMBARI-3558 > Project: Ambari > Issue Type: Bug > Components: agent > Reporter: Andrew Onischuk > Assignee: Andrew Onischuk > Fix For: 1.5.0 > > > A lot resources are based on execing different cmd commands, so when these commands fail, we have very unhelpfull messages. > Here how it looks like: > {code} > Traceback (most recent call last): > File "/root/workspace/tests/tests/test1.py", line 13, in > main() > File "/root/workspace/tests/tests/test1.py", line 10, in main > env.run() > File "/usr/lib/python2.6/site-packages/resource_management/environment.py", line 117, in run > self.run_action(resource, action) > File "/usr/lib/python2.6/site-packages/resource_management/environment.py", line 78, in run_action > provider_action() > File "/usr/lib/python2.6/site-packages/resource_management/providers/service/__init__.py", line 32, in action_reload > self._exec_cmd("reload", 0) > File "/usr/lib/python2.6/site-packages/resource_management/providers/service/__init__.py", line 58, in _exec_cmd > self, command, self.resource.service_name)) > resource_management.exceptions.Fail: RedhatServiceProvider[Service['ambari-agent']] command reload for service ambari-agent failed > {code} > Here how it should looklike: > {code} > Traceback (most recent call last): > File "/root/workspace/tests/tests/test1.py", line 13, in > main() > File "/root/workspace/tests/tests/test1.py", line 10, in main > env.run() > File "/usr/lib/python2.6/site-packages/resource_management/environment.py", line 117, in run > self.run_action(resource, action) > File "/usr/lib/python2.6/site-packages/resource_management/environment.py", line 78, in run_action > provider_action() > File "/usr/lib/python2.6/site-packages/resource_management/providers/service/__init__.py", line 32, in action_reload > self._exec_cmd("reload", 0) > File "/usr/lib/python2.6/site-packages/resource_management/providers/service/__init__.py", line 58, in _exec_cmd self, command, self.resource.service_name)) > resource_management.exceptions.Fail: Command 'yum -e 0 -d 0 install hadoop-dfs -y' failed with return code 1: > No package a available. > Error: Nothing to do > {code} > This will help a lot in future for users of the resource manager. -- This message was sent by Atlassian JIRA (v6.1#6144)