Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12318

Expose underlying LDAP exceptions in SaslPlainServer

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: security
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      In the code of class SaslPlainServer, the underlying exception is not included in the SaslException, which leads to below error message in HiveServer2:

      2015-07-22 11:50:28,433 DEBUG org.apache.thrift.transport.TSaslServerTransport: failed to open server transport
      org.apache.thrift.transport.TTransportException: PLAIN auth failed: Error validating LDAP user
      	at org.apache.thrift.transport.TSaslTransport.sendAndThrowMessage(TSaslTransport.java:232)
      	at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:316)
      	at org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:41)
      	at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216)
      	at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:268)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      Make COEs very hard to understand what the real error is.

      Can we change that line as:

          } catch (Exception e) {
            throw new SaslException("PLAIN auth failed: " + e.getMessage(), e);
          }
      

        Activity

        Hide
        lmccay Larry McCay added a comment -

        That seems reasonable to me.

        Show
        lmccay Larry McCay added a comment - That seems reasonable to me.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        -1 pre-patch 15m 22s Findbugs (version ) appears to be broken on trunk.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 tests included 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 javac 7m 40s There were no new javac warning messages.
        +1 javadoc 9m 44s There were no new javadoc warning messages.
        +1 release audit 0m 21s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 0m 39s There were no new checkstyle issues.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 22s mvn install still works.
        +1 eclipse:eclipse 0m 31s The patch built with eclipse:eclipse.
        +1 findbugs 1m 51s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        -1 common tests 22m 36s Tests failed in hadoop-common.
            60m 18s  



        Reason Tests
        Failed unit tests hadoop.net.TestNetUtils
          hadoop.ha.TestZKFailoverController



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12750145/HADOOP-12318.000.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / 1c12adb
        hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/7454/artifact/patchprocess/testrun_hadoop-common.txt
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/7454/testReport/
        Java 1.7.0_55
        uname Linux asf907.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-HADOOP-Build/7454/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment -1 pre-patch 15m 22s Findbugs (version ) appears to be broken on trunk. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac 7m 40s There were no new javac warning messages. +1 javadoc 9m 44s There were no new javadoc warning messages. +1 release audit 0m 21s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 0m 39s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 22s mvn install still works. +1 eclipse:eclipse 0m 31s The patch built with eclipse:eclipse. +1 findbugs 1m 51s The patch does not introduce any new Findbugs (version 3.0.0) warnings. -1 common tests 22m 36s Tests failed in hadoop-common.     60m 18s   Reason Tests Failed unit tests hadoop.net.TestNetUtils   hadoop.ha.TestZKFailoverController Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12750145/HADOOP-12318.000.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 1c12adb hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/7454/artifact/patchprocess/testrun_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/7454/testReport/ Java 1.7.0_55 uname Linux asf907.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-HADOOP-Build/7454/console This message was automatically generated.
        Hide
        atm Aaron T. Myers added a comment -

        +1, the patch looks good to me. I don't think we need a test for this since it's just adding a new cause for an exception. I ran both of the failed tests and they passed locally for me, so I think the failures are unrelated.

        I'm going to commit this momentarily.

        Show
        atm Aaron T. Myers added a comment - +1, the patch looks good to me. I don't think we need a test for this since it's just adding a new cause for an exception. I ran both of the failed tests and they passed locally for me, so I think the failures are unrelated. I'm going to commit this momentarily.
        Hide
        atm Aaron T. Myers added a comment -

        I've just committed this to trunk and branch-2.

        Thanks very much for the contribution, Mike.

        Show
        atm Aaron T. Myers added a comment - I've just committed this to trunk and branch-2. Thanks very much for the contribution, Mike.
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #8289 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8289/)
        HADOOP-12318. Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8289 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8289/ ) HADOOP-12318 . Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        Hide
        stevel@apache.org Steve Loughran added a comment -

        -1. It's critical to use Exception.toString() and not .getMessage(), as some exceptions (NPE) don't have messages.

        please roll back and add one which reports exceptions fully.

        Show
        stevel@apache.org Steve Loughran added a comment - -1. It's critical to use Exception.toString() and not .getMessage(), as some exceptions (NPE) don't have messages. please roll back and add one which reports exceptions fully.
        Hide
        stevel@apache.org Steve Loughran added a comment -

        Looking @ the patch more, the patch itself isn't introducing the getmessage bug, merely retaining it. Even so, this is the time to fix as its only going to lead to messages like "auth failed cause: Null"

        Show
        stevel@apache.org Steve Loughran added a comment - Looking @ the patch more, the patch itself isn't introducing the getmessage bug, merely retaining it. Even so, this is the time to fix as its only going to lead to messages like "auth failed cause: Null"
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #286 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/286/)
        HADOOP-12318. Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #286 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/286/ ) HADOOP-12318 . Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk #1016 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1016/)
        HADOOP-12318. Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6)

        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #1016 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1016/ ) HADOOP-12318 . Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java hadoop-common-project/hadoop-common/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2213 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2213/)
        HADOOP-12318. Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6)

        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2213 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2213/ ) HADOOP-12318 . Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java hadoop-common-project/hadoop-common/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #275 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/275/)
        HADOOP-12318. Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #275 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/275/ ) HADOOP-12318 . Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #283 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/283/)
        HADOOP-12318. Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #283 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/283/ ) HADOOP-12318 . Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk #2232 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2232/)
        HADOOP-12318. Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6)

        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2232 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2232/ ) HADOOP-12318 . Expose underlying LDAP exceptions in SaslPlainServer. Contributed by Mike Yoder. (atm: rev 820f864a26d90e9f4a3584577df581dcac20f9b6) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPlainServer.java hadoop-common-project/hadoop-common/CHANGES.txt
        Hide
        atm Aaron T. Myers added a comment -

        Hey Steve, thanks a lot for taking a look at this patch, and I think your point is a good one. Mind if we file a new JIRA to make this change? Seems like that'd make the history a bit cleaner than reverting this patch and applying a new one with the revision you're suggesting.

        Show
        atm Aaron T. Myers added a comment - Hey Steve, thanks a lot for taking a look at this patch, and I think your point is a good one. Mind if we file a new JIRA to make this change? Seems like that'd make the history a bit cleaner than reverting this patch and applying a new one with the revision you're suggesting.

          People

          • Assignee:
            yoderme Mike Yoder
            Reporter:
            yoderme Mike Yoder
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development