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 62FED200CFD for ; Wed, 6 Sep 2017 23:50:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6182B1609E3; Wed, 6 Sep 2017 21:50:09 +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 A64531609BA for ; Wed, 6 Sep 2017 23:50:08 +0200 (CEST) Received: (qmail 50347 invoked by uid 500); 6 Sep 2017 21:50:07 -0000 Mailing-List: contact issues-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list issues@ambari.apache.org Received: (qmail 50338 invoked by uid 99); 6 Sep 2017 21:50:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2017 21:50:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 93A321A6B41 for ; Wed, 6 Sep 2017 21:50:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 12vFg4FKW8UK for ; Wed, 6 Sep 2017 21:50:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 8C17F61260 for ; Wed, 6 Sep 2017 21:50:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4D669E0DB8 for ; Wed, 6 Sep 2017 21:50:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 8FAF924158 for ; Wed, 6 Sep 2017 21:50:02 +0000 (UTC) Date: Wed, 6 Sep 2017 21:50:02 +0000 (UTC) From: "Jayush Luniya (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMBARI-21897) Fix NPE in InstallHostTask MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 06 Sep 2017 21:50:09 -0000 [ https://issues.apache.org/jira/browse/AMBARI-21897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16156081#comment-16156081 ] Jayush Luniya commented on AMBARI-21897: ---------------------------------------- This can also occur in 2.6 if there are no client components on a host. > Fix NPE in InstallHostTask > -------------------------- > > Key: AMBARI-21897 > URL: https://issues.apache.org/jira/browse/AMBARI-21897 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Affects Versions: 2.6.0 > Reporter: Jayush Luniya > Assignee: Jayush Luniya > Priority: Blocker > Fix For: 2.6.0 > > Attachments: AMBARI-21897.patch > > > {code} > Exception in thread "pool-4-thread-1" java.lang.NullPointerException > at org.apache.ambari.server.topology.tasks.InstallHostTask.runTask(InstallHostTask.java:54) > at org.apache.ambari.server.topology.tasks.TopologyHostTask.run(TopologyHostTask.java:51) > at org.apache.ambari.server.topology.HostOfferResponse$1.run(HostOfferResponse.java:83) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > {code} > This seems to be because response can be null if stages is null and we don't have a check for it. > {code} > RequestStatusResponse response = clusterTopology.installHost(hostRequest.getHostName(), skipInstallTaskCreate, skipFailure); > List underlyingTasks = response.getTasks(); > {code} > {code} > /** > * 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 hostRoleCommands = > actionManager.getRequestTasks(id); > response.setRequestContext(actionManager.getRequestContext(id)); > List tasks = new ArrayList<>(); > for (HostRoleCommand hostRoleCommand : hostRoleCommands) { > tasks.add(new ShortTaskStatus(hostRoleCommand)); > } > response.setTasks(tasks); > } > return response; > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)