<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hiveserver2 Delegation Token Errors in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-Fix-quot-getDelegationToken-can-be-called-only-in/m-p/105849#M254597</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/768/pvyas.html" nodeid="768"&gt;@pvyas&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It looks like you may be running into &lt;A target="_blank" href="https://issues.apache.org/jira/browse/HIVE-4625"&gt;HIVE-4625&lt;/A&gt;. This bug presents when Hiveserver2 is running with doAs enabled (hive.server2.enable.doAs=true). Best practices for securing the cluster call for running Hiveserver2 with doAs disabled because of the ability for a user to skirt Hive authorization policies in Ranger by going directly to HDFS to read files. Here is a link to the article: &lt;A target="_blank" href="http://hortonworks.com/blog/best-practices-for-hive-authorization-using-apache-ranger-in-hdp-2-2/"&gt;Best Practices for Hive Authorization&lt;/A&gt;. Setting doAs to false should also solve your issue of delegation token errors. This bug is corrected in Hive 1.2 which is included with HDP 2.3 and Hiveserver2 will not ask for delegation tokens from metastore any more.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jan 2016 00:22:32 GMT</pubDate>
    <dc:creator>emaxwell</dc:creator>
    <dc:date>2016-01-22T00:22:32Z</dc:date>
    <item>
      <title>How to Fix "getDelegationToken() can be called only in thrift" Errors in HiveServer2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-Fix-quot-getDelegationToken-can-be-called-only-in/m-p/105848#M254596</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Hiveserver2 is non-responsive and the log reveals below error.&lt;/P&gt;
&lt;P&gt;Cluster is Kerberos enabled and there is no HA on Hive.&lt;/P&gt;
&lt;PRE&gt;hive.cluster.delegation.token.store.class - org.apache.hadoop.hive.thrift.ZooKeeperTokenStore
Ambari V 2.0
HDP V 2.2.4.2 
2016-01-19 23:20:18,466 ERROR [HiveServer2-Handler-Pool: Thread-159]: metadata.Hive (Hive.java:getDelegationToken(291
0)) - java.lang.UnsupportedOperationException: getDelegationToken() can be called only in thrift (non local) mode
  at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getDelegationToken(HiveMetaStoreClient.java:1664)
  at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:90)
  at com.sun.proxy.$Proxy12.getDelegationToken(Unknown Source)
  at org.apache.hadoop.hive.ql.metadata.Hive.getDelegationToken(Hive.java:2908)
  at org.apache.hive.service.cli.CLIService.getDelegationTokenFromMetaStore(CLIService.java:467)
  at org.apache.hive.service.cli.thrift.ThriftCLIService.getDelegationToken(ThriftCLIService.java:340)
  at org.apache.hive.service.cli.thrift.ThriftCLIService.getSessionHandle(ThriftCLIService.java:321)
  at org.apache.hive.service.cli.thrift.ThriftCLIService.OpenSession(ThriftCLIService.java:235)
  at org.apache.hive.service.cli.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1253)
  at org.apache.hive.service.cli.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1238)
  at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
  at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
  at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge20S$Server$TUGIAssumingProcessor.process(HadoopThriftA
uthBridge20S.java:679)
  at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
  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)&lt;/PRE&gt;
&lt;P&gt;Appreciate your help!&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 18:46:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-Fix-quot-getDelegationToken-can-be-called-only-in/m-p/105848#M254596</guid>
      <dc:creator>PranayV</dc:creator>
      <dc:date>2026-05-15T18:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Hiveserver2 Delegation Token Errors</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-Fix-quot-getDelegationToken-can-be-called-only-in/m-p/105849#M254597</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/768/pvyas.html" nodeid="768"&gt;@pvyas&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It looks like you may be running into &lt;A target="_blank" href="https://issues.apache.org/jira/browse/HIVE-4625"&gt;HIVE-4625&lt;/A&gt;. This bug presents when Hiveserver2 is running with doAs enabled (hive.server2.enable.doAs=true). Best practices for securing the cluster call for running Hiveserver2 with doAs disabled because of the ability for a user to skirt Hive authorization policies in Ranger by going directly to HDFS to read files. Here is a link to the article: &lt;A target="_blank" href="http://hortonworks.com/blog/best-practices-for-hive-authorization-using-apache-ranger-in-hdp-2-2/"&gt;Best Practices for Hive Authorization&lt;/A&gt;. Setting doAs to false should also solve your issue of delegation token errors. This bug is corrected in Hive 1.2 which is included with HDP 2.3 and Hiveserver2 will not ask for delegation tokens from metastore any more.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2016 00:22:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-Fix-quot-getDelegationToken-can-be-called-only-in/m-p/105849#M254597</guid>
      <dc:creator>emaxwell</dc:creator>
      <dc:date>2016-01-22T00:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Hiveserver2 Delegation Token Errors</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-Fix-quot-getDelegationToken-can-be-called-only-in/m-p/105850#M254598</link>
      <description>&lt;P&gt;Thank You very much &lt;A rel="user" href="https://community.cloudera.com/users/98/emaxwell.html" nodeid="98"&gt;@emaxwell&lt;/A&gt;. This helps&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2016 03:37:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-Fix-quot-getDelegationToken-can-be-called-only-in/m-p/105850#M254598</guid>
      <dc:creator>PranayV</dc:creator>
      <dc:date>2016-01-24T03:37:38Z</dc:date>
    </item>
  </channel>
</rss>

