Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8627

NPE thrown if unable to fetch token from Namenode

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      DelegationTokenFetcher#saveDelegationToken
      Missed to check if token is null.

          Token<?> token = fs.getDelegationToken(renewer);
          Credentials cred = new Credentials();
          cred.addToken(token.getKind(), token);
      
      XXXXXXXXXXXXXXXXXX:~/hadoop/namenode/bin> ./hdfs fetchdt --renewer Rex /home/REX/file1
      Exception in thread "main" java.lang.NullPointerException
              at org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.saveDelegationToken(DelegationTokenFetcher.java:181)
              at org.apache.hadoop.hdfs.tools.DelegationTokenFetcher$1.run(DelegationTokenFetcher.java:126)
              at java.security.AccessController.doPrivileged(AccessController.java:314)
              at javax.security.auth.Subject.doAs(Subject.java:572)
              at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1666)
              at org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.main(DelegationTokenFetcher.java:114)
      
      1. HDFS-8627.1.patch
        3 kB
        J.Andreina
      2. HDFS-8627.2.patch
        3 kB
        J.Andreina

        Activity

        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #233 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/233/)
        HDFS-8627. NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java
        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #233 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/233/ ) HDFS-8627 . NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2172 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2172/)
        HDFS-8627. NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2172 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2172/ ) HDFS-8627 . NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2190 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2190/)
        HDFS-8627. NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2190 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2190/ ) HDFS-8627 . NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk-Java8 #242 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/242/)
        HDFS-8627. NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk-Java8 #242 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/242/ ) HDFS-8627 . NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #8093 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8093/)
        HDFS-8627. NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8093 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8093/ ) HDFS-8627 . NPE thrown if unable to fetch token from Namenode (Contributed by J.Andreina) (vinayakumarb: rev 7ba5bbac02b688f68a8d23671a1e869234b4cebe) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDelegationTokenFetcher.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        vinayrpet Vinayakumar B added a comment -

        Committed to trunk.

        Not applicable to branch-2 as code is different there.

        Thanks J.Andreina for contribution.

        Show
        vinayrpet Vinayakumar B added a comment - Committed to trunk. Not applicable to branch-2 as code is different there. Thanks J.Andreina for contribution.
        Hide
        andreina J.Andreina added a comment -

        Testcase Failures are not related to this patch.

        Show
        andreina J.Andreina added a comment - Testcase Failures are not related to this patch.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        -1 pre-patch 18m 44s Pre-patch trunk has 1 extant Findbugs (version 3.0.0) warnings.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 tests included 0m 0s The patch appears to include 1 new or modified test files.
        +1 javac 7m 40s There were no new javac warning messages.
        +1 javadoc 9m 58s There were no new javadoc warning messages.
        +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 2m 21s There were no new checkstyle issues.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 34s mvn install still works.
        +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse.
        +1 findbugs 3m 15s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        +1 native 3m 18s Pre-build of native portion
        -1 hdfs tests 162m 54s Tests failed in hadoop-hdfs.
            210m 42s  



        Reason Tests
        Failed unit tests hadoop.hdfs.web.TestWebHdfsFileSystemContract
          hadoop.hdfs.TestHDFSFileSystemContract



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12742722/HDFS-8627.2.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / d3797f9
        Pre-patch Findbugs warnings https://builds.apache.org/job/PreCommit-HDFS-Build/11545/artifact/patchprocess/trunkFindbugsWarningshadoop-hdfs.html
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11545/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11545/testReport/
        Java 1.7.0_55
        uname Linux asf904.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/11545/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment -1 pre-patch 18m 44s Pre-patch trunk has 1 extant Findbugs (version 3.0.0) warnings. +1 @author 0m 0s The patch does not contain any @author tags. +1 tests included 0m 0s The patch appears to include 1 new or modified test files. +1 javac 7m 40s There were no new javac warning messages. +1 javadoc 9m 58s There were no new javadoc warning messages. +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 2m 21s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 34s mvn install still works. +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse. +1 findbugs 3m 15s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 native 3m 18s Pre-build of native portion -1 hdfs tests 162m 54s Tests failed in hadoop-hdfs.     210m 42s   Reason Tests Failed unit tests hadoop.hdfs.web.TestWebHdfsFileSystemContract   hadoop.hdfs.TestHDFSFileSystemContract Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12742722/HDFS-8627.2.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / d3797f9 Pre-patch Findbugs warnings https://builds.apache.org/job/PreCommit-HDFS-Build/11545/artifact/patchprocess/trunkFindbugsWarningshadoop-hdfs.html hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11545/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11545/testReport/ Java 1.7.0_55 uname Linux asf904.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HDFS-Build/11545/console This message was automatically generated.
        Hide
        vinayrpet Vinayakumar B added a comment -

        +1
        Will commit shortly

        Show
        vinayrpet Vinayakumar B added a comment - +1 Will commit shortly
        Hide
        andreina J.Andreina added a comment -

        Thanks Vinayakumar B for reviewing .
        Attached an updated patch.
        Please review.

        Show
        andreina J.Andreina added a comment - Thanks Vinayakumar B for reviewing . Attached an updated patch. Please review.
        Hide
        vinayrpet Vinayakumar B added a comment -

        Patch looks almost okay.

        Small Nit in test.
        Instead of trying to read and expecting IOException as below, can directly check for the existence of the token file. Token file should not get created in case of null token.

        +    Credentials.readTokenStorageFile(p, conf);
        Show
        vinayrpet Vinayakumar B added a comment - Patch looks almost okay. Small Nit in test. Instead of trying to read and expecting IOException as below, can directly check for the existence of the token file. Token file should not get created in case of null token. + Credentials.readTokenStorageFile(p, conf);
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 17m 32s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 tests included 0m 0s The patch appears to include 1 new or modified test files.
        +1 javac 7m 26s There were no new javac warning messages.
        +1 javadoc 9m 36s There were no new javadoc warning messages.
        +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 2m 17s There were no new checkstyle issues.
        -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix.
        +1 install 1m 36s mvn install still works.
        +1 eclipse:eclipse 0m 32s The patch built with eclipse:eclipse.
        +1 findbugs 3m 15s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        +1 native 3m 14s Pre-build of native portion
        +1 hdfs tests 161m 42s Tests passed in hadoop-hdfs.
            207m 34s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12742110/HDFS-8627.1.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / 8ef07f7
        whitespace https://builds.apache.org/job/PreCommit-HDFS-Build/11499/artifact/patchprocess/whitespace.txt
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11499/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11499/testReport/
        Java 1.7.0_55
        uname Linux asf906.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/11499/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 17m 32s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. +1 tests included 0m 0s The patch appears to include 1 new or modified test files. +1 javac 7m 26s There were no new javac warning messages. +1 javadoc 9m 36s There were no new javadoc warning messages. +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 2m 17s There were no new checkstyle issues. -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix. +1 install 1m 36s mvn install still works. +1 eclipse:eclipse 0m 32s The patch built with eclipse:eclipse. +1 findbugs 3m 15s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 native 3m 14s Pre-build of native portion +1 hdfs tests 161m 42s Tests passed in hadoop-hdfs.     207m 34s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12742110/HDFS-8627.1.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 8ef07f7 whitespace https://builds.apache.org/job/PreCommit-HDFS-Build/11499/artifact/patchprocess/whitespace.txt hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11499/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11499/testReport/ Java 1.7.0_55 uname Linux asf906.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HDFS-Build/11499/console This message was automatically generated.
        Hide
        andreina J.Andreina added a comment -

        Attached an initial patch.
        Please review.

        Show
        andreina J.Andreina added a comment - Attached an initial patch. Please review.

          People

          • Assignee:
            andreina J.Andreina
            Reporter:
            andreina J.Andreina
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development