ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jayush Luniya (JIRA)" <>
Subject [jira] [Created] (AMBARI-21897) Fix NPE in InstallHostTask
Date Wed, 06 Sep 2017 20:28:00 GMT
Jayush Luniya created AMBARI-21897:

             Summary: Fix NPE in InstallHostTask
                 Key: AMBARI-21897
             Project: Ambari
          Issue Type: Bug
          Components: ambari-server
    Affects Versions: 3.0.0
            Reporter: Jayush Luniya
            Assignee: Jayush Luniya
            Priority: Blocker
             Fix For: 3.0.0

Exception in thread "pool-4-thread-1" java.lang.NullPointerException
        at org.apache.ambari.server.topology.tasks.InstallHostTask.runTask(
        at org.apache.ambari.server.topology.HostOfferResponse$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

This seems to be because response can be null if stages is null and we don't have a check
for it. 

    RequestStatusResponse response = clusterTopology.installHost(hostRequest.getHostName(),
skipInstallTaskCreate, skipFailure);
      List<ShortTaskStatus> underlyingTasks = response.getTasks();

 * Build a request status response.
 * @return a {@link org.apache.ambari.server.controller.RequestStatusResponse} for the request
public RequestStatusResponse getRequestStatusResponse() {
  RequestStatusResponse response = null;

  if (! stages.isEmpty()) {
    response = new RequestStatusResponse(id);
    List<HostRoleCommand> hostRoleCommands =

    List<ShortTaskStatus> tasks = new ArrayList<>();

    for (HostRoleCommand hostRoleCommand : hostRoleCommands) {
      tasks.add(new ShortTaskStatus(hostRoleCommand));
  return response;

This message was sent by Atlassian JIRA

View raw message