Getting errors while running hive commands:show table and show databases


7 Answer(s)


I believe the issue is the vm is using the derby metastore that does not allow multiple connections, and the vm as shipped has the Hue service running against the metastore.

Stop the hue service;

sudo service hue stop

and you should be able to use hive from the command line.

Hi David,

Thanks for your help on this. I tried that option. What you told look like relevant. However I am getting a different error this time.Not able to figure out whats wrong. I didn't change anything to the default CDH3 distribution.
Please suggest if you have any clue.


FAILED: Error in metadata: javax.jdo.JDOFatalDatastoreException: Cannot get a co nnection, pool error Could not create validated object, cause: A read-only use r or a user in a read-only database is not permitted to disable read-only mode o n a connection. DestedThrowables: org.allache•FWWWW.dbCP.SQLNestedException: Cannot get a connection, pool error Could not create validated object, cause: A read-only user or a user in a read -only database is not permitted to disable read-only mode on conection. FAILED: Execution Err, return code I from org.apache.hadoop.hive.ql.exec.DDLTask

The only other thing I did was;

cd /var/lib/hive/metastore/metastore_db
chmod a+rwx . --recursive

Hi Shubhankar,

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!!

Finally the error got resolved!!!!

Thank you everyone for your help.

Great. I was getting the same error. Its resolved now too.

thanks buddy.

Hi DeZyre Support ,

But i have to do this same (rm *.lck) again and again when i want to import a new table from mysql.