<?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 Exception while executing insert query on kerberos+encryption enabled cluster in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104121#M25461</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have cluster with kerberos + HDFS Transparent encryption enabled. While executing query from beeline i am getting following error:&lt;/P&gt;&lt;P&gt;0: &amp;gt; insert into sample_test_src values(100);
INFO  : Number of reduce tasks is set to 0 since there's no reduce operator
INFO  : Cleaning up the staging area /user/adpqa/.staging/job_1460636656326_0016
ERROR : Job Submission failed with exception 'java.io.IOException(java.lang.reflect.UndeclaredThrowableException)'
java.io.IOException: java.lang.reflect.UndeclaredThrowableException
at org.apache.hadoop.crypto.key.kms.KMSClientProvider.addDelegationTokens(KMSClientProvider.java:888)
at org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.addDelegationTokens(KeyProviderDelegationTokenExtension.java:86)
at org.apache.hadoop.hdfs.DistributedFileSystem.addDelegationTokens(DistributedFileSystem.java:2243)
at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:121)
at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:100)
at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodes(TokenCache.java:80)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:166)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1287)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:575)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:570)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:570)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:561)
at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.execute(ExecDriver.java:431)
at org.apache.hadoop.hive.ql.exec.mr.MapRedTask.execute(MapRedTask.java:137)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:89)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1703)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1460)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1237)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1101)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1096)
at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:154)
at org.apache.hive.service.cli.operation.SQLOperation.access$100(SQLOperation.java:71)
at org.apache.hive.service.cli.operation.SQLOperation$1$1.run(SQLOperation.java:206)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hive.service.cli.operation.SQLOperation$1.run(SQLOperation.java:218)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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)
Caused by: java.lang.reflect.UndeclaredThrowableException
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1672)
at org.apache.hadoop.crypto.key.kms.KMSClientProvider.addDelegationTokens(KMSClientProvider.java:870)
... 40 more
Caused by: org.apache.hadoop.security.authentication.client.AuthenticationException: Authentication failed, status: 403, message: Forbidden
at org.apache.hadoop.security.authentication.client.AuthenticatedURL.extractToken(AuthenticatedURL.java:274)
at org.apache.hadoop.security.authentication.client.PseudoAuthenticator.authenticate(PseudoAuthenticator.java:77)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.authenticate(DelegationTokenAuthenticator.java:128)
at org.apache.hadoop.security.authentication.client.KerberosAuthenticator.authenticate(KerberosAuthenticator.java:214)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.authenticate(DelegationTokenAuthenticator.java:128)
at org.apache.hadoop.security.authentication.client.AuthenticatedURL.openConnection(AuthenticatedURL.java:215)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.doDelegationTokenOperation(DelegationTokenAuthenticator.java:285)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.getDelegationToken(DelegationTokenAuthenticator.java:166)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL.getDelegationToken(DelegationTokenAuthenticatedURL.java:371)
at org.apache.hadoop.crypto.key.kms.KMSClientProvider$2.run(KMSClientProvider.java:875)
at org.apache.hadoop.crypto.key.kms.KMSClientProvider$2.run(KMSClientProvider.java:870)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
... 41 more&lt;/P&gt;&lt;P&gt;Any idea on what could be wrong/missing here? I have similar query works fine from Hive CLI.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Apr 2016 20:55:15 GMT</pubDate>
    <dc:creator>vmshah</dc:creator>
    <dc:date>2016-04-18T20:55:15Z</dc:date>
    <item>
      <title>Exception while executing insert query on kerberos+encryption enabled cluster</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104121#M25461</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have cluster with kerberos + HDFS Transparent encryption enabled. While executing query from beeline i am getting following error:&lt;/P&gt;&lt;P&gt;0: &amp;gt; insert into sample_test_src values(100);
INFO  : Number of reduce tasks is set to 0 since there's no reduce operator
INFO  : Cleaning up the staging area /user/adpqa/.staging/job_1460636656326_0016
ERROR : Job Submission failed with exception 'java.io.IOException(java.lang.reflect.UndeclaredThrowableException)'
java.io.IOException: java.lang.reflect.UndeclaredThrowableException
at org.apache.hadoop.crypto.key.kms.KMSClientProvider.addDelegationTokens(KMSClientProvider.java:888)
at org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.addDelegationTokens(KeyProviderDelegationTokenExtension.java:86)
at org.apache.hadoop.hdfs.DistributedFileSystem.addDelegationTokens(DistributedFileSystem.java:2243)
at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:121)
at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:100)
at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodes(TokenCache.java:80)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:166)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1287)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:575)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:570)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:570)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:561)
at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.execute(ExecDriver.java:431)
at org.apache.hadoop.hive.ql.exec.mr.MapRedTask.execute(MapRedTask.java:137)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:89)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1703)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1460)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1237)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1101)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1096)
at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:154)
at org.apache.hive.service.cli.operation.SQLOperation.access$100(SQLOperation.java:71)
at org.apache.hive.service.cli.operation.SQLOperation$1$1.run(SQLOperation.java:206)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hive.service.cli.operation.SQLOperation$1.run(SQLOperation.java:218)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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)
Caused by: java.lang.reflect.UndeclaredThrowableException
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1672)
at org.apache.hadoop.crypto.key.kms.KMSClientProvider.addDelegationTokens(KMSClientProvider.java:870)
... 40 more
Caused by: org.apache.hadoop.security.authentication.client.AuthenticationException: Authentication failed, status: 403, message: Forbidden
at org.apache.hadoop.security.authentication.client.AuthenticatedURL.extractToken(AuthenticatedURL.java:274)
at org.apache.hadoop.security.authentication.client.PseudoAuthenticator.authenticate(PseudoAuthenticator.java:77)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.authenticate(DelegationTokenAuthenticator.java:128)
at org.apache.hadoop.security.authentication.client.KerberosAuthenticator.authenticate(KerberosAuthenticator.java:214)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.authenticate(DelegationTokenAuthenticator.java:128)
at org.apache.hadoop.security.authentication.client.AuthenticatedURL.openConnection(AuthenticatedURL.java:215)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.doDelegationTokenOperation(DelegationTokenAuthenticator.java:285)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.getDelegationToken(DelegationTokenAuthenticator.java:166)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL.getDelegationToken(DelegationTokenAuthenticatedURL.java:371)
at org.apache.hadoop.crypto.key.kms.KMSClientProvider$2.run(KMSClientProvider.java:875)
at org.apache.hadoop.crypto.key.kms.KMSClientProvider$2.run(KMSClientProvider.java:870)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
... 41 more&lt;/P&gt;&lt;P&gt;Any idea on what could be wrong/missing here? I have similar query works fine from Hive CLI.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2016 20:55:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104121#M25461</guid>
      <dc:creator>vmshah</dc:creator>
      <dc:date>2016-04-18T20:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Exception while executing insert query on kerberos+encryption enabled cluster</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104122#M25462</link>
      <description>&lt;P&gt;In the beeline command please check if the Hive principal name is set correctly and matching the cluster settings. &lt;/P&gt;&lt;P&gt;Also ensure that the kerberos  ticket is still available. &lt;/P&gt;&lt;PRE&gt;!connect jdbc:hive2://sandbox.hortonworks.com:10000/default;principal=hive/_HOST@REALM.COM&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Apr 2016 22:59:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104122#M25462</guid>
      <dc:creator>pbalasundaram</dc:creator>
      <dc:date>2016-04-18T22:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Exception while executing insert query on kerberos+encryption enabled cluster</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104123#M25463</link>
      <description>&lt;P&gt;Service Principal name is specified correctly and kerberos ticket is also available. &lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 16:37:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104123#M25463</guid>
      <dc:creator>vmshah</dc:creator>
      <dc:date>2016-04-19T16:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Exception while executing insert query on kerberos+encryption enabled cluster</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104124#M25464</link>
      <description>&lt;P&gt;In the below, I am assuming that &lt;/P&gt;&lt;P&gt;a) the &lt;A href="http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.4/bk_hdfs_admin_tools/content/hive-access-encr.html"&gt;hive warehouse dirs were moved to an ecnryption zone&lt;/A&gt; and &lt;/P&gt;&lt;P&gt;b) as recommended in our docs when Ranger is installed, hive.server2.enable.doas is set to false in hive configs (ie the queries are run as 'hive' user)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Probable root cause&lt;/EM&gt;: The 403 error message may mean there is an authorization issue (Ranger is blocking access). Best way to confirm this is to check Ranger audits. &lt;/P&gt;&lt;P&gt;1. Check if user is being denied at Hive or HDFS level: Login to Ranger as admin and navigate to audits tab and filter for Result = Denied&lt;/P&gt;&lt;P&gt;2. Check if 'hive' user is being denied access to encryption zone containing hive warehouse tables. To do this:&lt;/P&gt;&lt;P&gt;a) First expose Audits view to keyadmin user: &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;login to Ranger as admin and click Settings tab &amp;gt; Permissions. &lt;/LI&gt;
&lt;LI&gt;Click 'Audit' (second row from bottom) to change users who have access to Audit screen&lt;/LI&gt;&lt;LI&gt;Under 'Select User', add 'keyadmin' user &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;b) Logoff as admin and relogin to Ranger as keyadmin user. Then navigate to audits tab and filter for Result = Denied&lt;/P&gt;&lt;P&gt;Most likely you will see requests getting denied by Ranger.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resolution&lt;/EM&gt;:&lt;/P&gt;&lt;P&gt;Once you confirm its an authorization issue, follow below to resolve:&lt;/P&gt;&lt;P&gt;1. check if the user (you are kinit'ed as before launching beeline) has is a &lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.0/bk_Ranger_User_Guide/content/hive_policy.html"&gt;Ranger hive policy&lt;/A&gt; allowing him/her access to the table&lt;/P&gt;&lt;P&gt;To check this, login to Ranger as admin and check the Hive policies&lt;/P&gt;&lt;P&gt;2. there is a KMS policy allowing 'hive' and 'nn' user access to the key used to encrypt the hive warehouse dir in HDFS (you may need to create these users in Ranger or sync from 'unix' once before you can do this)&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;CODE&gt;nn&lt;/CODE&gt; user needs at least  &lt;CODE&gt;GetMetaData&lt;/CODE&gt; and &lt;CODE&gt;GenerateEEK&lt;/CODE&gt; privilege&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;hive&lt;/CODE&gt; user needs at least  &lt;CODE&gt;GetMetaData&lt;/CODE&gt; and &lt;CODE&gt;DecryptEEK&lt;/CODE&gt; privilege&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 20 Apr 2016 05:31:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104124#M25464</guid>
      <dc:creator>abajwa</dc:creator>
      <dc:date>2016-04-20T05:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Exception while executing insert query on kerberos+encryption enabled cluster</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104125#M25465</link>
      <description>&lt;P&gt;Thanks Ali for the details.&lt;/P&gt;&lt;P&gt;Later yesterday we added following configurations to our setup.&lt;/P&gt;&lt;P&gt;hadoop.kms.proxyuser.&lt;STRONG&gt;user1&lt;/STRONG&gt;.users =  *&lt;/P&gt;&lt;P&gt;hadoop.kms.proxyuser.&lt;STRONG&gt;user1&lt;/STRONG&gt;.hosts = *&lt;/P&gt;&lt;P&gt;We were impersonating user1 and we had ticket generated for the user. Push-down queries are working fine now.&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 13:18:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104125#M25465</guid>
      <dc:creator>vmshah</dc:creator>
      <dc:date>2016-04-20T13:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Exception while executing insert query on kerberos+encryption enabled cluster</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104126#M25466</link>
      <description>&lt;P&gt;Hey Vishal ..where did you added these properties ..&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 20:58:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Exception-while-executing-insert-query-on-kerberos/m-p/104126#M25466</guid>
      <dc:creator>Sreedhar_ch</dc:creator>
      <dc:date>2016-07-19T20:58:03Z</dc:date>
    </item>
  </channel>
</rss>

