1-844-696-6465 (US)        +91 77600 44484        help@dezyre.com

Getting error when accessing HIVE commands



0
Accessing HIVE commands getting below error :::

hive> show tables;
FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Cannot get a connection, pool error Could not create a validated object, cause: A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection.
NestedThrowables:
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Could not create a validated object, cause: A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection.
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

3 Answer(s)


0

Hi Praveen,

The error message shows that a connection pool is not being created as the current user is a read-only user and don't have write permissions on metastore_db files.
This happens when we try to login to hive from a different user other than permitted.
The easiest way to get rid of it is to give all permissions to all users to required files.[required files location must have come when you had seen the second exception]
Below are the steps:
1. Check which user are you using to login.
Command: whoami
2. Now do a ls to the location to see if the user have enough write and execute permissions.
Command: ls -l [location] [default is /var/lib/hive/metastore/metastore_db]
3. From step2 list, check what all permissions are available to files under metastore_db
It should be 'rwx' for the user you got from step1.
4. If not, give rwx permissions to all user using a sudo command.
Command: cd [location]
Command: sudo chmod a+rwx . --recursive
Command: rm *.lck

Hope this solves the problem.
Please post, if still you get the error.

Happy Learning @ Dezyre!!

0

Hi, the solution provided worked. Thanks for the answer.

0

Hi,

I am having same issue.

In ambari Hortonworks in hive view there are multiple queries in running state,but i am unable to stop them.

and as you told the above solution, i am unable to locate the folder path

i.e var/lib/metastore/metastore_db

i dont have metastore_db folder.

i have only var/lib/metastore  and it has rwx permission.

 

what should i do?

please help me.

Thanks

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password