AbsaOSS / enceladus

Dynamic Conformance Engine
Apache License 2.0
31 stars 14 forks source link

Invalid keytab file throws NPE #1010

Open Zejnilovic opened 5 years ago

Zejnilovic commented 5 years ago

Describe the bug

Keytab authorization throws NPE in case of the keytab not being keytab. Like using credentials file but specifying keytab.

To Reproduce

Steps to reproduce the behavior OR commands run:

  1. Run std or conf with --menas-auth-keytab pointing to a plain file or anything else
  2. Get error

Expected behaviour

I would expect an error like Couldn't extract credentials from keytab or something similar.

Stack

19/11/06 07:08:33 INFO state.StateStoreCoordinatorRef: Registered StateStoreCoordinator endpoint
Exception in thread "main" java.lang.NullPointerException
    at za.co.absa.enceladus.dao.menasplugin.MenasAuthUtils.getKerberosCredentias(MenasAuthUtils.scala:50)
    at za.co.absa.enceladus.dao.menasplugin.MenasKerberosCredentials$.fromFile(MenasCredentials.scala:55)
    at za.co.absa.enceladus.dao.menasplugin.MenasKerberosCredentialsFactory.getInstance(MenasCredentialsFactory.scala:43)
    at za.co.absa.enceladus.standardization.StandardizationJob$.main(StandardizationJob.scala:61)
    at za.co.absa.enceladus.standardization.StandardizationJob.main(StandardizationJob.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
    at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:845)
    at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:161)
    at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:184)
    at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
    at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:920)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:929)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
19/11/06 07:08:35 INFO spark.SparkContext: Invoking stop() from shutdown hook
yruslan commented 5 years ago

👍 Good spot