Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Hive CLI login issue

avatar
Explorer

Hi All

I am having a strange issue when I tried to login from "infa" user.

I have no issue with "hive" user.

[infa@bdm ~]$ hive log4j:WARN No such property [maxFileSize] in org.apache.log4j.DailyRollingFileAppender. Logging initialized using configuration in file:/etc/hive/2.6.3.0-235/0/hive-log4j.properties Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Permission denied at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:552) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:233) at org.apache.hadoop.util.RunJar.main(RunJar.java:148) Caused by: java.lang.RuntimeException: java.io.IOException: Permission denied at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:545) ... 8 more Caused by: java.io.IOException: Permission denied at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createTempFile(File.java:2024) at org.apache.hadoop.hive.common.FileUtils.createTempFile(FileUtils.java:885) at org.apache.hadoop.hive.ql.session.SessionState.createTempFile(SessionState.java:858) at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:543) ... 8 more

I have checked the HDFS directories in Hive under /tmp for write access to infa user for below folders and it has the write access.

drwxrwxrwx - infa hdfs 0 2018-09-27 10:33 /tmp/hive

drwxrwxrwx - hive hdfs 0 2018-09-25 15:01 /tmp/hive1

drwxr-xr-x - hdfs hdfs 0 2018-09-06 21:21 /tmp/infa

Do i miss something here ?

Thx

Muthu

3 REPLIES 3

avatar
Expert Contributor

This issue is happening because user infa does not have privilege to create local directory in /tmp/

You can launch hive with custom local directory which might have privileges for infa user.

hive --hiveconf hive.exec.local.scratchdir=<local machine path>

avatar
Explorer

Hi Naresh

the above comment worked fine for the hive logging. But the actual issue is due to permission issue in ./tmp/infa folder.

Once I granted the permissions to this folder the issue got resolved.

thx

Muthu

avatar
Expert Contributor

Glad to hear that the issue is resolved. You can either create local folder & give permissions or Hive will create hive.exec.local.scratchdir & provide permissions as configured in hive.scratch.dir.permission

Provided if the user is having privileges on parent directory.

If my answer helped to resolve the issue, accept the answer. It might help others in the community.