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

FastSaslClientFactory failing to initialise due to NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 3.4.0, 3.3.6, 3.4.1, 3.4.2
    • None
    • common, security
    • RHEL9

    Description

      FastSaslClientFactory is instantiated in both SaslRpcClient and SaslParticipant as new FastSaslClientFactory(null)

      In its constructor FastSaslClientFactory loads all the SaslFactories using Sasl.getSaslClientFactories();

      Then it iterates through all the loaded factories and calls getMechanismNames method.

      The null argument sent in the constructor is sent to the getMechanismNames call.

      In some-cases, a loaded factory might not handle this null argument and might throw a NPE.

      This can cause the entire FastSaslClientFactory to not instantiate leading to failure while instantiation of SaslRpcClient.

      Code Pointer - https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/FastSaslClientFactory.java#L43

      Stack Trace - 

      Cause3: java.lang.ExceptionInInitializerError: Exception java.lang.NullPointerException [in thread "ServiceScheduler:GridforceSfdcLogUploaderProcess"] Cause3-StackTrace:   at org.apache.qpid.client.security.amqplain.AmqPlainSaslClientFactory.getMechanismNames(AmqPlainSaslClientFactory.java:50)  at org.apache.hadoop.security.FastSaslClientFactory.<init>(FastSaslClientFactory.java:47)  at org.apache.hadoop.security.SaslRpcClient.<clinit>(SaslRpcClient.java:106)  at org.apache.hadoop.ipc.Client$Connection.setupSaslConnection(Client.java:559)  at org.apache.hadoop.ipc.Client$Connection.access$2100(Client.java:347)  at org.apache.hadoop.ipc.Client$Connection$2.run(Client.java:783)  at org.apache.hadoop.ipc.Client$Connection$2.run(Client.java:779)  at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)  at java.base/javax.security.auth.Subject.doAs(Subject.java:439)  at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899)  at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:779)  at org.apache.hadoop.ipc.Client$Connection.access$3800(Client.java:347)  at org.apache.hadoop.ipc.Client.getConnection(Client.java:1632)  at org.apache.hadoop.ipc.Client.call(Client.java:1457)  at org.apache.hadoop.ipc.Client.call(Client.java:1410)  at org.apache.hadoop.ipc.ProtobufRpcEngine2$Invoker.invoke(ProtobufRpcEngine2.java:258)  at org.apache.hadoop.ipc.ProtobufRpcEngine2$Invoker.invoke(ProtobufRpcEngine2.java:139)  at jdk.proxy2/jdk.proxy2.$Proxy1500.getFileInfo(Unknown Source)  at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.lambda$getFileInfo$41(ClientNamenodeProtocolTranslatorPB.java:811)  at org.apache.hadoop.ipc.internal.ShadedProtobufHelper.ipc(ShadedProtobufHelper.java:160)  at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:811)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)  ... 23 shared with parent` 

      Attachments

        1. stacktrace.txt
          8 kB
          Abhey Rana

        Issue Links

          Activity

            People

              UselessCoder Abhey Rana
              UselessCoder Abhey Rana
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 96h
                  96h
                  Remaining:
                  Remaining Estimate - 96h
                  96h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified