Home Forums HDP on Linux – Installation HIVE authorization issue

This topic contains 8 replies, has 6 voices, and was last updated by  T K 6 months ago.

  • Creator
    Topic
  • #30131

    Lebing XIE
    Member

    I installed HDP exactly followed the manuel guide. During the smoking test for HIVE, I got such error:

    hive> CREATE TABLE pokes2 (foo INT, bar STRING);
    Authorization failed:org.apache.hadoop.security.AccessControlException: action WRITE not permitted on path hdfs://localhost:8020/ for user hive. Use show grant to get more details.

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #52839

    T K
    Participant

    Hello All,

    The use case that I am working with may not necessarily be the same that will potentially generate the same error for you. However; here is the summary of how I researched the issue and resolved it.

    1) Was logged in as ROOT and invoked hive
    [root@xxxx hdfs]# hive
    2) Created a table
    hive> create table t1 (a int);
    3) Tried loading data in this table from hdfs file
    hive> load data inpath ‘/tmp/group’ into table t1;

    This threw the infamous error.
    Authorization failed:java.security.AccessControlException: action WRITE not permitted on path hdfs://nnclust/apps/hive/warehouse/t1 for user hdfs. Use SHOW GRANT to get more details.

    On doing some research, it was identified that since i created the table logged through the hive prompt which was invoked as root it maintained that same permissions on the data store

    [hdfs@xxxxx hdfs]$ hadoop fs -ls /apps/hive/warehouse/
    Found 1 items
    drwxr-xr-x – root hdfs 0 2014-05-02 15:03 /apps/hive/warehouse/t1

    4) Issued a chown command
    hadoop fs -chown hdfs:hdfs /apps/hive/warehouse/t1

    And the data loaded successfully.

    hive> load data inpath ‘/tmp/group’ into table t1;
    Loading data to table default.t1
    Table default.t1 stats: [numFiles=1, numRows=0, totalSize=989, rawDataSize=0]
    OK
    Time taken: 3.026 seconds

    Collapse
    #48137

    Pete Meers
    Participant

    I had this problem when I tried the hive command using the ‘hadoop’ user I set up in the install.. (i.e. runas /user:hadoop cmd)
    However when I just open a command window as my own userid it works OK.

    Collapse
    #38224

    Dave
    Moderator

    Hi Lebing / Boris,

    Is your user hive in the hadoop group (as their Primary group?) on the Linux system?

    Thanks

    Dave

    Collapse
    #37980

    Boris Minkin
    Member

    I have exactly the same issue
    Did somebody figure out how to fix it?
    -Boris

    create table test(col1 int, col2 string);
    Authorization failed:org.apache.hadoop.security.AccessControlException: action WRITE not permitted on path file:/ for user hive. Use show grant to get more details.
    NoViableAltException(26@[592:1: ddlStatement : ( createDatabaseStatement | switchDatabaseStatement | dropDatabaseStatement | createTableStatement | dropTableStatement | truncateTableStatement | alterStatement | descStatement | showStatement | metastoreCheck | createViewStatement | dropViewStatement | createFunctionStatement | createIndexStatement | dropIndexStatement | dropFunctionStatement | analyzeStatement | lockStatement | unlockStatement | createRoleStatement | dropRoleStatement | grantPrivileges | revokePrivileges | showGrants | showRoleGrants | grantRole | revokeRole );])
    at org.antlr.runtime.DFA.noViableAlt(DFA.java:158)
    at org.antlr.runtime.DFA.predict(DFA.java:144)
    at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:1933)
    at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1273)
    at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:928)

    Collapse
    #37802

    Boris Minkin
    Member

    I’m having exactly similar issue:
    Authorization failed:org.apache.hadoop.security.AccessControlException: action WRITE not permitted on path file:/ for user hive. Use show grant to get more details.
    When I do show grants; it shows:
    hive> show grants;
    NoViableAltException(26@[592:1: ddlStatement : ( createDatabaseStatement | switchDatabaseStatement | dropDatabaseStatement | createTableStatement | dropTableStatement | truncateTableStatement | alterStatement | descStatement | showStatement | metastoreCheck | createViewStatement | dropViewStatement | createFunctionStatement | createIndexStatement | dropIndexStatement | dropFunctionStatement | analyzeStatement | lockStatement | unlockStatement | createRoleStatement | dropRoleStatement | grantPrivileges | revokePrivileges | showGrants | showRoleGrants | grantRole | revokeRole );])
    at org.antlr.runtime.DFA.noViableAlt(DFA.java:158)
    at org.antlr.runtime.DFA.predict(DFA.java:144)
    at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:1933)
    at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1273)
    at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:928)
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:190)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:418)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:337)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:902)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
    FAILED: ParseException line 1:5 cannot recognize input near ‘show’ ‘grants’ ” in ddl statement

    How can I fix it?

    Collapse
    #30404

    Robert
    Participant

    Hi Lebing,
    Have you tried running those commands as user hdfs and not as zookeeper user?

    Regards,
    Robert

    Collapse
    #30133

    Lebing XIE
    Member

    As I install HBASE, I found following error

    $ /usr/lib/hadoop/bin/hadoop fs -mkdir /apps/hbase
    /usr/lib/hadoop/bin/hadoop fs -chown -R hbase /apps/hbasemkdir: org.apache.hadoop.security.AccessControlException: Permission denied: user=zookeeper, access=WRITE, inode=”/”:hdfs:hdfs:drwxr-xr-x

    Seemed all the user zookeeper, hbase … (but hdfs) can not write in HDFS. Did I miss a step in the guide?

    Collapse
    #30132

    Lebing XIE
    Member

    I started HDFS with user “hdfs”, HIVE with user “hive”

    Collapse
Viewing 8 replies - 1 through 8 (of 8 total)