Support Questions
Find answers, ask questions, and share your expertise

Can't execute query - Permission denied?,Can't execute DDL query


Hi, I encountered this 'permission denied - 500' error when executing the DDL query.

<small>java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException( Permission denied: user=hive, access=WRITE, inode="/apps":hdfs:hdfs:drwxr-xr-x
	at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(
	at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(
	at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(
	at org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkPermission(
	at org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkPermission(
	at org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkPathAccess(
	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkAccess(
	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.checkAccess(
	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.checkAccess(
	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 org.apache.hadoop.ipc.Server$ </small>


I am on admin account. I need help as this is my first time dealing with HDCloud.
Thank you very much.



Connect to hdp vm server as root, then switch hdfs user and then check directory ownership & permission.

[root@fqdn]# su hdfs

[hdfs@fqdn]# hdfs dfs -ls /apps

[hdfs@fqdn]# hdfs dfs -ls /apps/hive

[hdfs@fqdn]# hdfs dfs -chmod 755 /apps/hive

[hdfs@fqdn]# hdfs dfs -chmod 777 /apps/hive/warehouse

if the ownership is incorrect, then try it.

[hdfs@fqdn]# hdfs dfs -chown hdfs:hdfs /apps/hive

[hdfs@fqdn]# hdfs dfs -chown hive:hdfs /apps/hive/warehouse


@Aditya Sirna Tried SSH the node, but now when I try
hdfs dfs -chmod 777/apps
it says

Permission denied: user=cloudbreak is not the owner of inode=apps

You have to run it as hdfs user

Run su hdfs and run the chmod command




Thank you so much. The query works now.

SSH to your node, run su hdfs, and then run the chmod command, and then execute the query.