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

Handle ClassCastException on AuthenticationException in LoadBalancingKMSClientProvider

    XMLWordPrintableJSON

Details

    Description

      An Oozie job with a single shell action fails (may not be important, but if you needs the exact details I can provide them) with an error message coming from NodeManager:

      2016-05-10 11:10:14,290 ERROR org.apache.hadoop.yarn.YarnUncaughtExceptionHandler: Thread Thread[LogAggregationService #652,5,main] threw an Exception.
      java.lang.ClassCastException: org.apache.hadoop.security.authentication.client.AuthenticationException cannot be cast to java.security.GeneralSecurityException
      at org.apache.hadoop.crypto.key.kms.LoadBalancingKMSClientProvider.decryptEncryptedKey(LoadBalancingKMSClientProvider.java:189)
      at org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.decryptEncryptedKey(KeyProviderCryptoExtension.java:388)
      at org.apache.hadoop.hdfs.DFSClient.decryptEncryptedDataEncryptionKey(DFSClient.java:1419)
      at org.apache.hadoop.hdfs.DFSClient.createWrappedOutputStream(DFSClient.java:1521)
      at org.apache.hadoop.fs.Hdfs.createInternal(Hdfs.java:108)
      at org.apache.hadoop.fs.Hdfs.createInternal(Hdfs.java:59)
      at org.apache.hadoop.fs.AbstractFileSystem.create(AbstractFileSystem.java:577)
      at org.apache.hadoop.fs.FileContext$3.next(FileContext.java:683)
      at org.apache.hadoop.fs.FileContext$3.next(FileContext.java:679)
      at org.apache.hadoop.fs.FSLinkResolver.resolve(FSLinkResolver.java:90)
      at org.apache.hadoop.fs.FileContext.create(FileContext.java:679)
      at org.apache.hadoop.yarn.logaggregation.AggregatedLogFormat$LogWriter$1.run(AggregatedLogFormat.java:382)
      at org.apache.hadoop.yarn.logaggregation.AggregatedLogFormat$LogWriter$1.run(AggregatedLogFormat.java:377)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAs(Subject.java:422)
      at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671)
      at org.apache.hadoop.yarn.logaggregation.AggregatedLogFormat$LogWriter.<init>(AggregatedLogFormat.java:376)
      at org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.AppLogAggregatorImpl.uploadLogsForContainers(AppLogAggregatorImpl.java:246)
      at org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.AppLogAggregatorImpl.doAppLogAggregation(AppLogAggregatorImpl.java:456)
      at org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.AppLogAggregatorImpl.run(AppLogAggregatorImpl.java:421)
      at org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.LogAggregationService$2.run(LogAggregationService.java:384)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      

      The unsafe cast is here:
      https://github.com/apache/hadoop/blob/2e1d0ff4e901b8313c8d71869735b94ed8bc40a0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/LoadBalancingKMSClientProvider.java#L189

      Because of this ClassCastException:

      • an uncaught exception is raised
      • we do not see the exact "caused by" exception/message
      • the oozie job fails
      • YARN logs are not reported/saved

      Attachments

        1. HADOOP-13132.001.patch
          2 kB
          Wei-Chiu Chuang
        2. HADOOP-13132.002.patch
          7 kB
          Wei-Chiu Chuang
        3. HADOOP-13132.003.patch
          7 kB
          Wei-Chiu Chuang
        4. HADOOP-13132.004.patch
          6 kB
          Wei-Chiu Chuang

        Activity

          People

            weichiu Wei-Chiu Chuang
            mszurap Miklos Szurap
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: