Support Questions

Find answers, ask questions, and share your expertise

In Sandbox, HDP 2.5, getting a Hive Cli error

avatar
Master Guru

FAILED: RuntimeException java.io.FileNotFoundException: /etc/hive/2.5.0.0-817/0/xasecure-audit.xml

I tried a few different users (root, hdfs, hive)

[hive@sandbox conf]$ hive cli
WARNING: Use "yarn jar" to launch YARN applications.
Logging initialized using configuration in file:/etc/hive/2.5.0.0-817/0/hive-log4j.properties
hive> show functions;
FAILED: RuntimeException java.io.FileNotFoundException: /etc/hive/2.5.0.0-817/0/xasecure-audit.xml (No such file or directory)
hive> show tables;
Exception in thread "main" java.lang.AssertionError: Authorization plugins not initialized!
at org.apache.hadoop.hive.ql.session.SessionState.getAuthorizationMode(SessionState.java:1509)
at org.apache.hadoop.hive.ql.session.SessionState.isAuthorizationModeV2(SessionState.java:1513)
at org.apache.hadoop.hive.ql.Driver.doAuthorization(Driver.java:626)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:506)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:318)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1197)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1245)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1134)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1124)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:216)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:168)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:379)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:739)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:684)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:624)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
[hive@sandbox conf]$
1 ACCEPTED SOLUTION

avatar

@Timothy Spann

Try setting hive.security.authorization.manager=org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory in hive-site and hive.security.authorization.enabled=false

You can search on ambari Hive for those configurations and test after changing them.

View solution in original post

5 REPLIES 5

avatar
Guru

A quick workaround is to disable ranger authorization from hive->authorization in ambari UI and restart hive. However, if ranger is part of your tests and want to keep it enabled, this is not the solution.

avatar

@Timothy Spann

Try setting hive.security.authorization.manager=org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory in hive-site and hive.security.authorization.enabled=false

You can search on ambari Hive for those configurations and test after changing them.

avatar
Expert Contributor

@Timothy Spann the above instructions by @Felix Albani should work. In Ambari it looks like so within the Hive configuration.

5636-screen-shot-2016-07-07-at-60329-pm.png

avatar

@Timothy Spann do you see this issue with beeline as well?

avatar
Super Collaborator

Hi @Timothy Spann, there is a bug from Ambari perspective, it is not generating hiveserver2-site.xml. So any changes made in Advanced Hiveserver2 site section from Ambari are not getting reflected, (we make changes in hiveserver2-site.xml for Ranger) so if you disable authorization from the general settings as mentioned above, you will be able to run Hive cli but Ranger policies will not work as expected. This issue has been raised up and will be resolved soon in the upcoming releases of Sandbox.

For now, you can use Hive but without any Ranger policies.