Unable to create database path file:/user/hive/warehouse Error

10,541

It says it is unable to open database /var/lib/hive/metastore/metastore_db,this error normally comes when you dnt have permission to access the database. Use below commond then reply me:

1)SUDO chmod -R 777 /VAR/LIB/HIVE/METASTORE/METASTORE_DB

2)chmod -R a+rwx /var/lib/hive/metastore/metastore_db

3) rm /var/lib/hive/metastore/metastore_db/*.lck

Share:
10,541
Ashish Sharma
Author by

Ashish Sharma

Updated on June 04, 2022

Comments

  • Ashish Sharma
    Ashish Sharma almost 2 years

    I have a 3 nodes cluster and I am getting following error while running some HIVE query

    FAILED: Error in metadata: MetaException(message:Unable to create database path file:/user/hive/warehouse/db_dut.db, failed to create database db_dut) FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

    My hive-site.xml contains following property

           <property>
          <name>javax.jdo.option.ConnectionURL</name>
          <value>jdbc:derby:;databaseName=/var/lib/hive/metastore/metastore_db;create=true</value>
          <description>JDBC connect string for a JDBC metastore</description>
        </property>
    
    <property>
      <name>hive.metastore.warehouse.dir</name>
      <value>/user/hive/warehouse</value>
      <description>location of default database for the warehouse</description>
    </property>
    

    >jdbc:derby:;databaseName=/var/lib/hive/metastore/metastore_db;create=true< is correctly present at my local machine.

    When i gave hadoop fs -ls /user/hive ..following output came

    [root@scaj02bda01 metastore]# hadoop fs -ls /user/hive
    Found 1 items
    drwxrwxrwx   - hive hive          0 2013-04-09 01:40 /user/hive/warehouse
    [root@scaj02bda01 metastore]# 
    

    The default database location for warehouse is correctly mentioned in HDFS with all read write execute permission, but still i am getting the same error.