Skip to main content
chrsvarma
Gold ⭐️
July 11, 2017
Solved

Fix HiveAccessControlException Permission Denied During Beeline INSERT OVERWRITE DIRECTORY

INSERT OVERWRITE DIRECTORY '/tmp' ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' STORED AS TEXTFILE SELECT visit_id, ivm from abcd.xyz WHERE feed_date BETWEEN '2006-04-01' and '2006-05-01' AND ivm IS NOT NULL limit 10;

Error: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [rvchinta] does not have [WRITE] privilege on [/tmp] (state=42000,code=40000) 0: jdbc:hive2://hostname.abc.com:8443>

ranger policy /tmp has 777 to public

HDP version 2.6.1

cros_romain
Gold ⭐️
January 27, 2018

I can confirm that I had the same problem on HDP 2.6.3. Like suggested, using the fully qualified path (hdfs://<cluster>/path) makes it work.

5 replies

chrsvarma
chrsvarmaAuthor
Gold ⭐️
July 11, 2017

I do not see this permission denied in ranger audit as well.

Translate
chrsvarma
chrsvarmaAuthor
Gold ⭐️
July 11, 2017

i updated directory path to hdfs:CLUSTERNAMEHA/tmp and it worked.

Translate
cros_romain
Gold ⭐️
January 27, 2018

I can confirm that I had the same problem on HDP 2.6.3. Like suggested, using the fully qualified path (hdfs://<cluster>/path) makes it work.

Translate
the_best_specia
Silver ⭐️
February 10, 2018

INSERT OVERWRITE DIRECTORY "hdfs://sandbox-hdp.hortonworks.com/tmp/hey2" SELECT * FROM mytable;


(i.e. you need to specify full name of cluster) works fine when you have correct configuration in Ranger, but INSERT OVERWRITE DIRECTORY "/tmp/hey2" SELECT * FROM mytable; will fail. At least this is true for HDP 2.6.3
Translate
teravaidya
Silver ⭐️⭐️⭐️
May 15, 2018

Hi,

Is there a workaround solution for the above or is it a behaviour of 2.6.3 and above?

Translate