Skip to main content
Seaport
Gold ⭐️
Jan 14, 2020 5:05 AM UTC
Solved

HDFS folder permission denied, but the user is in the owner group.

I am using HDP. The inode in the following code is a managed hive table.

 

# id zeppelin
uid=1017(zeppelin) gid=1003(hadoop) groups=1003(hadoop),1005(zeppelin)
# sudo -u zeppelin hadoop fs -ls /warehouse/tablespace/managed/hive/test1
ls: Permission denied: user=zeppelin, access=READ_EXECUTE, inode="/warehouse/tablespace/managed/hive/test1":hive:hadoop:drwxrwx---

 

The user zeppelin is in hadoop group, which has full permisison on the hdfs folder. So why do I get the permission error?

EricL
EricLAnswer
Platinum ⭐️⭐️
Jan 15, 2020 3:14 AM UTC
@Seaport,

Please refer to documentation here:
https://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-common/FileSystemShell.html#setfacl

Maybe try:

sudo -u hdfs hadoop fs -setfacl -m group:hadoop:r-x /warehouse/tablespace/managed/hive/test1

8 replies

EricL
Platinum ⭐️⭐️
Platinum ⭐️⭐️
Jan 14, 2020 6:17 AM UTC
@Seaport ,

Can you try:

hdfs groups zeppelin

Or run "id zeppelin" on the active NN host?
Translate
Seaport
SeaportAuthor
Gold ⭐️
Jan 14, 2020 4:05 PM UTC

# hdfs groups zeppelin
zeppelin : hadoop zeppelin

 

On the name node, 

# id zeppelin
uid=1018(zeppelin) gid=1003(hadoop) groups=1003(hadoop),1005(zeppelin)

Translate
Seaport
SeaportAuthor
Gold ⭐️
Jan 14, 2020 5:49 PM UTC

I might have found the reason.

 

I ran the following command as hdfs, which is the superuser of hdfs.

$ hadoop fs -getfacl /warehouse/tablespace/managed/hive/test1
# file: /warehouse/tablespace/managed/hive/test1
# owner: hive
# group: hadoop
user::rwx
user:hive:rwx
group::---
mask::rwx
other::---
default:user::rwx
default:user:hive:rwx
default:group::---
default:mask::rwx
default:other::---

 

The output, as I understand, shows that the group owner has no permission on the folder. My guess is that, HDP Hive uses ACL to limit direct access to files behind managed tables. HDP Hive tries to force accessing to managed tables only through Hive.

Translate