title: Delegation Token can be issued only with kerberos or web authentication Spark action Oozie
body: <p>I have a cluster with (hadoop-2.7.3), hbase (1.2), zookeeper (zookeeper-3.4.8), phoenix (apache-phoenix-4.10.0), spark (2.2.0) and oozie (4.3.0). All components ara config with kerberos (less spark).</p>
  
  <p>When I try to deploy spark action with Oozie to kerberized hadoop cluster, in yarn logs (stdout) i have this error:</p>
  
  <pre><code>Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.SparkMain], main() threw exception, Delegation Token can be issued only with kerberos or web authentication
      at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getDelegationToken(FSNamesystem.java:6642)
      at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getDelegationToken(NameNodeRpcServer.java:564)
      at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.getDelegationToken(ClientNamenodeProtocolServerSideTranslatorPB.java:987)
      at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
      at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
      at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:982)
      at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2049)
      at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2045)
      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:1698)
      at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2043)
  </code></pre>
  
  <p>My workflow is like:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;credentials&gt;
           &lt;credential name='hb' type='hbase'&gt;
                  &lt;property&gt;
                          &lt;name&gt;hadoop.security.authentication&lt;/name&gt;
                          &lt;value&gt;kerberos&lt;/value&gt;
                  &lt;/property&gt;
                  &lt;property&gt;
                          &lt;name&gt;hbase.security.authentication&lt;/name&gt;
                          &lt;value&gt;kerberos&lt;/value&gt;
                  &lt;/property&gt;
                  &lt;property&gt;
                          &lt;name&gt;hbase.master.kerberos.principal&lt;/name&gt;
                          &lt;value&gt;hbase/host@REALM&lt;/value&gt;
                  &lt;/property&gt;
                  &lt;property&gt;
                          &lt;name&gt;hbase.regionserver.kerberos.principal&lt;/name&gt;
                          &lt;value&gt;hbase/host@REALM&lt;/value&gt;
                  &lt;/property&gt;
                  &lt;property&gt;
                          &lt;name&gt;hbase.zookeeper.quorum&lt;/name&gt;
                          &lt;value&gt;domain&lt;/value&gt;
                  &lt;/property&gt;
                  &lt;property&gt;
                          &lt;name&gt;hadoop.rpc.protection&lt;/name&gt;
                          &lt;value&gt;authentication&lt;/value&gt;
                  &lt;/property&gt;
                  &lt;property&gt;
                          &lt;name&gt;hbase.rpc.protection&lt;/name&gt;
                          &lt;value&gt;authentication&lt;/value&gt;
                  &lt;/property&gt;
                  &lt;property&gt;
                          &lt;name&gt;hbase.master.keytab.file&lt;/name&gt;
                          &lt;value&gt;/etc/security/keytabs/hbase.keytab&lt;/value&gt;
                  &lt;/property&gt;
                  &lt;property&gt;
                          &lt;name&gt;hbase.regionserver.keytab.file&lt;/name&gt;
                          &lt;value&gt;/etc/security/keytabs/hbase.keytab&lt;/value&gt;
                  &lt;/property&gt;
           &lt;/credential&gt;
          &lt;/credentials&gt;
  
  &lt;action name="action_name" cred="hb"&gt;
      &lt;spark xmlns="uri:oozie:spark-action:0.2"&gt;
              &lt;job-tracker&gt;${jobTracker}&lt;/job-tracker&gt;
              &lt;name-node&gt;${nameNode}&lt;/name-node&gt;
              &lt;master&gt;yarn&lt;/master&gt;
              &lt;mode&gt;cluster&lt;/mode&gt;
              &lt;name&gt;spark action name&lt;/name&gt;
              &lt;class&gt;com.sparkclass&lt;/class&gt;
              &lt;jar&gt;spark_code.jar&lt;/jar&gt;
              &lt;spark-opts&gt;--queue jobs --file hbase-site.xml&lt;/spark-opts&gt;
              &lt;arg&gt;-D&lt;/arg&gt;
              &lt;arg&gt;hbase.zookeeper.quorum=${zkQuorum}&lt;/arg&gt;
              &lt;arg&gt;-D&lt;/arg&gt;
              &lt;arg&gt;hbase.zookeeper.client.port=${zkClientPort}&lt;/arg&gt;
              &lt;arg&gt;${date}&lt;/arg&gt;
              &lt;arg&gt;${arg2}&lt;/arg&gt;
              &lt;arg&gt;${arg3}&lt;/arg&gt;
              &lt;file&gt;${nameNode}/user/${wf:user()}/jobs/lib/hbase-site.xml&lt;/file&gt;
      &lt;/spark&gt;
      &lt;ok to="end"/&gt;
      &lt;error to="fail"/&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>I have a java action, sqoop action and works perfect, and only in a spark action, i have this problem. </p>
  
  <p>I try to change a java action, and shell action whitout results. Maybe i need to change my code?</p>
  
  <p>Thanks</p>