The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

HDP on Linux – Installation Forum

HIVE authorization issue

  • #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.

  • Author
    Replies
  • #30132
    Lebing XIE
    Member

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

    #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?

    #30404
    Robert
    Participant

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

    Regards,
    Robert

    #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?

    #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)

    #38224
    Dave
    Moderator

    Hi Lebing / Boris,

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

    Thanks

    Dave

    #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.

    #52839
    T K
    Moderator

    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

The forum ‘HDP on Linux – Installation’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.