Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Access Control Exception while adding partition to hive

Access Control Exception while adding partition to hive


My table is an external table.Following is the alter table command 



ALTER TABLE db.table ADD PARTITION (date='07-12-2016') ;


 Exception :--


  • Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Got exception: Permission denied: user=admin, access=WRITE, inode="/user/admin/..../...":root:admin:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkFsPermission( at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.check( at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.check( at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkPermission( at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission( at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission( at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission( at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkAncestorAccess( at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInternal( at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInt( at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs( at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.mkdirs( at org.apache.hadoop.hdfs.server.namenode.AuthorizationProviderProxyClientProtocol.mkdirs( at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.mkdirs( at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod( at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ at org.apache.hadoop.ipc.RPC$ at org.apache.hadoop.ipc.Server$Handler$ at org.apache.hadoop.ipc.Server$Handler$ at Method) at at at org.apache.hadoop.ipc.Server$ )

Re: Access Control Exception while adding partition to hive




From the error, I can see the following:


1. you used user "admin" to run the ALTER command

2. the directory that will be updated is under "/user/admin/..../..." and it is owned by user "root" and group "admin"

3. directory "/user/admin/..../..." has the permission of 755, which means only user "root" can WRITE/MODIFY the directory


So if you want to get the query working, you need to 


- use user "root" to run the query OR

- make sure that the directory is WRITABLE by group "admin" if user "admin" is part of group "admin"


Hope above helps.



Don't have an account?
Coming from Hortonworks? Activate your account here