Return-Path: X-Original-To: apmail-hadoop-common-dev-archive@www.apache.org Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC7E4D467 for ; Tue, 28 May 2013 06:32:31 +0000 (UTC) Received: (qmail 43854 invoked by uid 500); 28 May 2013 06:32:30 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 42691 invoked by uid 500); 28 May 2013 06:32:23 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 41445 invoked by uid 99); 28 May 2013 06:32:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 May 2013 06:32:20 +0000 Date: Tue, 28 May 2013 06:32:20 +0000 (UTC) From: "WenJin Ma (JIRA)" To: common-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HADOOP-9603) Run "hdfs zkfc-formatZK" on a server in a non-namenode will cause a null pointer exception. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 WenJin Ma created HADOOP-9603: --------------------------------- Summary: Run "hdfs zkfc-formatZK" on a server in a non-namenode will cause a null pointer exception. Key: HADOOP-9603 URL: https://issues.apache.org/jira/browse/HADOOP-9603 Project: Hadoop Common Issue Type: Bug Components: auto-failover, fs Affects Versions: 2.0.4-alpha Reporter: WenJin Ma Run "hdfs zkfc-formatZK" on a server in a non-namenode will cause a null pointer exception. {code} [hadoop@test bin]$ ./hdfs zkfc -formatZK Exception in thread "main" java.lang.NullPointerException at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187) at org.apache.hadoop.hdfs.tools.NNHAServiceTarget.(NNHAServiceTarget.java:57) at org.apache.hadoop.hdfs.tools.DFSZKFailoverController.create(DFSZKFailoverController.java:128) at org.apache.hadoop.hdfs.tools.DFSZKFailoverController.main(DFSZKFailoverController.java:172) {code} I look at the code, found in the org.apache.hadoop.hdfs.DFSUtil.getSuffixIDs () method does not make judgments on this issue. {code} static String[] getSuffixIDs(final Configuration conf, final String addressKey, String knownNsId, String knownNNId, final AddressMatcher matcher) { String nameserviceId = null; String namenodeId = null; int found = 0; //......do something if (found > 1) { // Only one address must match the local address String msg = "Configuration has multiple addresses that match " + "local node's address. Please configure the system with " + DFS_NAMESERVICE_ID + " and " + DFS_HA_NAMENODE_ID_KEY; throw new HadoopIllegalArgumentException(msg); } // If the IP is not a local address, found to be less than 1. // There should be throw an exception with clear message rather than cause a null pointer exception. return new String[] { nameserviceId, namenodeId }; {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira