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 7257C200B74 for ; Thu, 1 Sep 2016 21:01:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 70FD5160AB7; Thu, 1 Sep 2016 19:01:23 +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 BE89E160AA8 for ; Thu, 1 Sep 2016 21:01:22 +0200 (CEST) Received: (qmail 15532 invoked by uid 500); 1 Sep 2016 19:01:22 -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 15516 invoked by uid 99); 1 Sep 2016 19:01:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2016 19:01:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D5F3A2C014F for ; Thu, 1 Sep 2016 19:01:21 +0000 (UTC) Date: Thu, 1 Sep 2016 19:01:21 +0000 (UTC) From: "Vitaly Brodetskyi (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (AMBARI-18296) Database Consistency Check Fails With NPE With Missing Service From Stack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 01 Sep 2016 19:01:23 -0000 [ https://issues.apache.org/jira/browse/AMBARI-18296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vitaly Brodetskyi reassigned AMBARI-18296: ------------------------------------------ Assignee: Vitaly Brodetskyi > Database Consistency Check Fails With NPE With Missing Service From Stack > ------------------------------------------------------------------------- > > Key: AMBARI-18296 > URL: https://issues.apache.org/jira/browse/AMBARI-18296 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Affects Versions: 2.4.0 > Reporter: Jonathan Hurley > Assignee: Vitaly Brodetskyi > Priority: Critical > Fix For: trunk > > Attachments: AMBARI-18296.patch > > > The database consistency checker can fail if a service configuration exists for a service which is no longer on the current stack: > {code} > 2016-08-31 21:52:28,082 INFO - ******************************* Check database started ******************************* 2016-08-31 21:52:31,647 INFO - Checking for configs not mapped to any cluster 2016-08-31 21:52:31,653 INFO - Checking for configs selected more than once 2016-08-31 21:52:31,655 INFO - Checking for hosts without state 2016-08-31 21:52:31,657 INFO - Checking host component states count equals host component desired states count 2016-08-31 21:52:31,660 INFO - Checking services and their configs 2016-08-31 21:52:33,669 ERROR - Unexpected error, database check failed java.lang.NullPointerException at org.apache.ambari.server.checks.DatabaseConsistencyCheckHelper.checkServiceConfigs(DatabaseConsistencyCheckHelper.java:543) at org.apache.ambari.server.checks.DatabaseConsistencyChecker.main(DatabaseConsistencyChecker.java:115) > {code} > It seems like what happens is this query returns a service which is not defined in the current stack: > {code} > SELECT > c.cluster_name, > cs.service_name, > cc.type_name, > sc.version > FROM clusterservices cs > JOIN serviceconfig sc > ON cs.service_name = sc.service_name > AND cs.cluster_id = sc.cluster_id > JOIN serviceconfigmapping scm > ON sc.service_config_id = scm.service_config_id > JOIN clusterconfig cc > ON scm.config_id = cc.config_id > AND sc.cluster_id = cc.cluster_id > JOIN clusters c > ON cc.cluster_id = c.cluster_id > AND sc.stack_id = c.desired_stack_id > WHERE sc.group_id IS NULL > AND sc.service_config_id = (SELECT > MAX(service_config_id) > FROM serviceconfig sc2 > WHERE sc2.service_name = sc.service_name > AND sc2.cluster_id = sc.cluster_id) > GROUP BY c.cluster_name, > cs.service_name, > cc.type_name, > sc.version > {code} > Problem area of code: > {code:title=serviceInfo is null} > for (String serviceName : serviceNames) { > ServiceInfo serviceInfo = serviceInfoMap.get(serviceName); > Set configTypes = serviceInfo.getConfigTypeAttributes().keySet(); > for (String configType : configTypes) { > stackServiceConfigs.put(serviceName, configType); > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)