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 <[email protected]> Authored: Mon Sep 25 19:08:49 2017 +0300 Committer: Myroslav Papirkovskyi <[email protected]> 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();
