This is an automated email from the ASF dual-hosted git repository.

jialiang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 6d032e87f5 AMBARI-26234: ClusterNotFoundException in stage Confirm 
Hosts during deploying a cluster #3875
6d032e87f5 is described below

commit 6d032e87f569a80bfc9be89450791f86bbf45ab2
Author: Peng Lu <[email protected]>
AuthorDate: Tue Nov 12 08:55:09 2024 +0800

    AMBARI-26234: ClusterNotFoundException in stage Confirm Hosts during 
deploying a cluster #3875
---
 .../ambari/server/events/publishers/AgentCommandsPublisher.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java
index 27f5115079..a31db1f848 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java
@@ -109,8 +109,12 @@ public class AgentCommandsPublisher {
             if (ac instanceof ExecutionCommand) {
               try {
                 clusterId = 
Long.valueOf(((ExecutionCommand)ac).getClusterId());
-                if (!clusterDesiredConfigs.containsKey(clusterId)) {
-                  clusterDesiredConfigs.put(clusterId, 
clusters.getCluster(clusterId).getDesiredConfigs());
+                if (clusterId >= 0) {
+                  if (!clusterDesiredConfigs.containsKey(clusterId)) {
+                    clusterDesiredConfigs.put(clusterId, 
clusters.getCluster(clusterId).getDesiredConfigs());
+                  }
+                } else {
+                  LOG.warn("The cluster not found or has not been created yet. 
clusterID={}.", clusterId);
                 }
               } catch (NumberFormatException|AmbariException e) {
                 LOG.error("Exception on sendAgentCommand", e);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to