Support Questions

Find answers, ask questions, and share your expertise

Hbase shell error

avatar
Contributor

/usr/local/Hbase/bin# ./hbase shell
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.java.invokers.RubyToJavaInvoker (file:/usr/local/Hbase/lib/jruby-complete-1.6.8.jar) to method java.lang.Object.registerNatives()
WARNING: Please consider reporting this to the maintainers of org.jruby.java.invokers.RubyToJavaInvoker
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
ArgumentError: wrong number of arguments (0 for 1)
method_added at file:/usr/local/Hbase/lib/jruby-complete-1.6.8.jar!/builtin/javasupport/core_ext/object.rb:10
method_added at file:/usr/local/Hbase/lib/jruby-complete-1.6.8.jar!/builtin/javasupport/core_ext/object.rb:129
Pattern at file:/usr/local/Hbase/lib/jruby-complete-1.6.8.jar!/builtin/java/java.util.regex.rb:2
(root) at file:/usr/local/Hbase/lib/jruby-complete-1.6.8.jar!/builtin/java/java.util.regex.rb:1
require at org/jruby/RubyKernel.java:1062
(root) at file:/usr/local/Hbase/lib/jruby-complete-1.6.8.jar!/builtin/java/java.util.regex.rb:42
(root) at /usr/local/Hbase/bin/../bin/hirb.rb:38
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/Hbase/lib/phoenix-5.0.0-HBase-2.0-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/Hbase/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/hadoop/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Manoj690 

 

This looks a hdfs permission, you are executing the command as the root user while the inode permission are hive:hadoop.See below

Error: Error while processing statement: FAILED: Execution Error, return
code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
MetaException(message:Got exception:
org.apache.hadoop.security.AccessControlException Permission denied:
user=root, access=EXECUTE,
inode="/warehouse/tablespace/managed/hive":hive:hadoop:drwx------
at
org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:399)

Can you do the following while logged on the CLI as root

# su - hive

$ hive

The execute your create table statement that should succeed if not share the log

View solution in original post

15 REPLIES 15

avatar
Contributor
su -hive
Usage: su [options] [LOGIN]

Options:
-c, --command COMMAND pass COMMAND to the invoked shell
-h, --help display this help message and exit
-, -l, --login make the shell a login shell
-m, -p,
--preserve-environment do not reset environment variables, and
keep the same shell
-s, --shell SHELL use SHELL instead of the default in passwd

avatar
Contributor

LOAD DATA LOCAL INPATH 'empdata.txt' OVERWRITE INTO TABLE emp;
Error: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: Principal [name=hive, type=USER] does not have following privileges for operation LOAD [ADMIN] (state=42000,code=40000)

avatar
Master Mentor

@Manoj690 

Be careful when switching user in Linux don't forget a [ ] space between the su and dash and username   marked with x  below

# sux-xuser   --------- --> su [dash] -  [dash] user

avatar
Contributor
LOAD DATA LOCAL INPATH 'empdata.txt' OVERWRITE INTO TABLE emp;
Error: Error while compiling statement: FAILED: HiveAccessControlException
Permission denied: Principal [name=hive, type=USER] does not have following
privileges for operation LOAD [ADMIN] (state=42000,code=40000)

avatar
Master Collaborator

@Manoj690 Check if their is any ranger policy or you can try disabling Authorization for HiveServer2 as follows:
### Ambari UI > Hive > Configs > Advanced > Advanced Hiveserver2-Site > Uncheck "Enable Authorization" Option > Restart Hive Service and run the query

avatar
Master Mentor

@Manoj690 

Can you check whether authorization has been delegated to Ranger/Kerbe/SQLAuth if you have Ranger plugin for Hive enabled then  the authorization has been delegated to Ranger the central authority. 

You will need to enable the permissions through ranger for all hive database

Hive > Configs > Settings > In Security it is set to ?