Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D2890200D06 for ; Mon, 25 Sep 2017 18:11:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C85341609E9; Mon, 25 Sep 2017 16:11:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 19C841609BB for ; Mon, 25 Sep 2017 18:11:20 +0200 (CEST) Received: (qmail 88490 invoked by uid 500); 25 Sep 2017 16:11:20 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 88477 invoked by uid 99); 25 Sep 2017 16:11:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Sep 2017 16:11:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 00EE3F551A; Mon, 25 Sep 2017 16:11:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mpapirkovskyy@apache.org To: commits@ambari.apache.org Date: Mon, 25 Sep 2017 16:11:19 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/4] ambari git commit: AMBARI-22026. Restart of all components on host operation failed with 500 status code. (mpapirkovskyy) archived-at: Mon, 25 Sep 2017 16:11:22 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.6 68b31ac2c -> 1cf1a2cec refs/heads/trunk 999daefe0 -> 4b59ba820 AMBARI-22026. Restart of all components on host operation failed with 500 status code. (mpapirkovskyy) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1a867723 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1a867723 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1a867723 Branch: refs/heads/branch-2.6 Commit: 1a867723b62abd1706cc1d088502f1973c7ccfba Parents: 68b31ac Author: Myroslav Papirkovskyi Authored: Mon Sep 25 19:08:49 2017 +0300 Committer: Myroslav Papirkovskyi Committed: Mon Sep 25 19:08:49 2017 +0300 ---------------------------------------------------------------------- .../AmbariCustomCommandExecutionHelper.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/1a867723/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java index 2b2144c..5f26565 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java @@ -1527,14 +1527,18 @@ public class AmbariCustomCommandExecutionHelper { if (actionName.equals(START_COMMAND_NAME) || actionName.equals(RESTART_COMMAND_NAME)) { Cluster cluster = clusters.getCluster(clusterName); StackId stackId = null; - try { - Service service = cluster.getService(serviceName); - stackId = service.getDesiredStackId(); - } catch (AmbariException e) { - LOG.debug("Could not load service {}, skipping topology check", serviceName); - stackId = cluster.getDesiredStackVersion(); + if (serviceName != null) { + try { + Service service = cluster.getService(serviceName); + stackId = service.getDesiredStackId(); + } catch (AmbariException e) { + LOG.debug("Could not load service {}, skipping topology check", serviceName); + } } + if (stackId == null) { + stackId = cluster.getDesiredStackVersion(); + } AmbariMetaInfo ambariMetaInfo = managementController.getAmbariMetaInfo();