Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-2358

NPE when the default filesystem's uri has no authority

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.204.0
    • Fix Version/s: 0.20.205.0
    • Component/s: namenode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Give meaningful error message instead of NPE.

      Description

      in core-site.xml if default filesystem's uri is misconfigured , NN does not come up and in NN shows NPE

      java.lang.NullPointerException
      at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:142)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:195)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:225)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:259)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:458)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1226)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1235)

      It is better to give meaningful error messege than NPE

        Activity

        Hide
        Daryn Sharp added a comment -

        Simple fix is to pass the full uri, instead of just the authority (which may be null) to getAddress(String). This will replace the NPE with a more descriptive IllegalArgumentException:

        "Does not contain a valid host:port authority: BAD-URI-HERE".

        Show
        Daryn Sharp added a comment - Simple fix is to pass the full uri, instead of just the authority (which may be null) to getAddress(String) . This will replace the NPE with a more descriptive IllegalArgumentException : "Does not contain a valid host:port authority: BAD-URI-HERE".
        Hide
        Daryn Sharp added a comment -

        Passes commit tests.

        Show
        Daryn Sharp added a comment - Passes commit tests.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12497045/HDFS-2358.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/1316//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12497045/HDFS-2358.patch against trunk revision . +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/1316//console This message is automatically generated.
        Hide
        Matt Foley added a comment -

        Daryn, please post your local test-patch results as a comment. Thanks.

        Show
        Matt Foley added a comment - Daryn, please post your local test-patch results as a comment. Thanks.
        Hide
        Daryn Sharp added a comment -

        [exec] +1 overall.
        [exec]
        [exec] +1 @author. The patch does not contain any @author tags.
        [exec]
        [exec] +1 tests included. The patch appears to include 3 new or modified tests.
        [exec]
        [exec] +1 javadoc. The javadoc tool did not generate any warning messages.
        [exec]
        [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings.
        [exec]
        [exec] +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.
        [exec]

        Show
        Daryn Sharp added a comment - [exec] +1 overall. [exec] [exec] +1 @author. The patch does not contain any @author tags. [exec] [exec] +1 tests included. The patch appears to include 3 new or modified tests. [exec] [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] [exec] +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. [exec]
        Hide
        Matt Foley added a comment -

        +1 for code review. Committed to both 0.20-sec and 0.20.205.0. Thanks, Daryn!

        Show
        Matt Foley added a comment - +1 for code review. Committed to both 0.20-sec and 0.20.205.0. Thanks, Daryn!
        Hide
        Suresh Srinivas added a comment -

        Is this required for trunk?

        Show
        Suresh Srinivas added a comment - Is this required for trunk?
        Hide
        Daryn Sharp added a comment -

        No, trunk explicitly checks for an authority so it doesn't have this problem.

        Show
        Daryn Sharp added a comment - No, trunk explicitly checks for an authority so it doesn't have this problem.
        Hide
        Matt Foley added a comment -

        Closed upon release of 0.20.205.0

        Show
        Matt Foley added a comment - Closed upon release of 0.20.205.0

          People

          • Assignee:
            Daryn Sharp
            Reporter:
            Rajit Saha
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development