<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Hive metastore can not access existing databases after integrating with Sentry in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-metastore-can-not-access-existing-databases-after/m-p/40971#M28734</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using&amp;nbsp;&lt;SPAN&gt;Cloudera Express 5.5.1 on Ubuntu.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have enabled Sentry authorisation on Hive as per Cloudera documentation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When i log in to Hue using Hive user and choose Metastore. I don't see all my databases that were previosuly created. &amp;nbsp;All i see is 'Default' Database. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have Hadoop groups option enabled and "hive" is the group on hadoop&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have 777 set on &lt;EM&gt;/user/hive/warehouse&lt;/EM&gt; directory and sub-directories&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have placed the sentry-provider.ini under /user/hive/sentry directory and it looks like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[groups] 
# Assigns each Hadoop group to its set of roles  
hive= admin_role  

[roles] # The uris below define a define a landing skid which 
# the user can use to import or export data from the system. 
# Since the server runs as the user "hive" files in that directory 
# must either have the group hive and read/write set or 
# be world read/write. 
# http://www.cloudera.com/documentation/enterprise/5-5-x/topics/sg_hive_sql.html
# Implies everything on server1 and database
admin_role = server=server1-&amp;gt;db=practice&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When i try to create a new database, it get the below errors&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[18/May/2016 01:42:49 -0700] middleware   INFO     Processing exception: Bad status for request TExecuteStatementReq(confOverlay={}, sessionHandle=TSessionHandle(sessionId=THandleIdentifier(secret='\x19fx\x06&amp;gt;[F\xaf\xb6,\x8a\xe6r\xdd\xb6R', guid='a2_\xb54\xcaB\x15\x9d7\x00\xd7\xc5P$h')), runAsync=False, statement='USE `default`'):
TExecuteStatementResp(status=TStatus(errorCode=40000, errorMessage='Error while compiling statement: FAILED: SemanticException No valid privileges\n User hive does not have privileges for SWITCHDATABASE', sqlState='42000', infoMessages=['*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException No valid privileges\n User hive does not have privileges for SWITCHDATABASE:17:16', 'org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:326', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:102', 'org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:171', 'org.apache.hive.service.cli.operation.Operation:run:Operation.java:268', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:410', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatement:HiveSessionImpl.java:391', 'org.apache.hive.service.cli.CLIService:executeStatement:CLIService.java:245', 'org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:509', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1313', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1298', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:285', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1145', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:615', 'java.lang.Thread:run:Thread.java:745', '*org.apache.hadoop.hive.ql.parse.SemanticException:No valid privileges\n User hive does not have privileges for SWITCHDATABASE:21:5', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:postAnalyze:HiveAuthzBindingHook.java:387', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:424', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:305', 'org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1110', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1104', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:100', '*org.apache.hadoop.hive.ql.metadata.AuthorizationException:User hive does not have privileges for SWITCHDATABASE:23:2', 'org.apache.sentry.binding.hive.authz.HiveAuthzBinding:authorize:HiveAuthzBinding.java:275', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:authorizeWithHiveBindings:HiveAuthzBindingHook.java:577', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:postAnalyze:HiveAuthzBindingHook.java:372'], statusCode=3), operationHandle=None): Traceback (most recent call last):
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/transaction.py", line 371, in inner
    return func(*args, **kwargs)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/create_database.py", line 49, in create_database
    return execute_directly(request, query, on_success_url=reverse('metastore:databases'))
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/views.py", line 764, in execute_directly
    db.use(database)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/dbms.py", line 527, in use
    return self.client.use(query)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 938, in use
    data = self._client.execute_query(query)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 679, in execute_query
    return self.execute_query_statement(statement=query.query['query'], max_rows=max_rows, configuration=configuration)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 683, in execute_query_statement
    (results, schema), operation_handle = self.execute_statement(statement=statement, max_rows=max_rows, configuration=configuration, orientation=orientation)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 711, in execute_statement
    res = self.call(self._client.ExecuteStatement, req)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 597, in call
    raise QueryServerException(Exception('Bad status for request %s:\n%s' % (req, res)), message=message)
QueryServerException: Bad status for request TExecuteStatementReq(confOverlay={}, sessionHandle=TSessionHandle(sessionId=THandleIdentifier(secret='\x19fx\x06&amp;gt;[F\xaf\xb6,\x8a\xe6r\xdd\xb6R', guid='a2_\xb54\xcaB\x15\x9d7\x00\xd7\xc5P$h')), runAsync=False, statement='USE `default`'):
TExecuteStatementResp(status=TStatus(errorCode=40000, errorMessage='Error while compiling statement: FAILED: SemanticException No valid privileges\n User hive does not have privileges for SWITCHDATABASE', sqlState='42000', infoMessages=['*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException No valid privileges\n User hive does not have privileges for SWITCHDATABASE:17:16', 'org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:326', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:102', 'org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:171', 'org.apache.hive.service.cli.operation.Operation:run:Operation.java:268', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:410', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatement:HiveSessionImpl.java:391', 'org.apache.hive.service.cli.CLIService:executeStatement:CLIService.java:245', 'org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:509', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1313', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1298', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:285', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1145', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:615', 'java.lang.Thread:run:Thread.java:745', '*org.apache.hadoop.hive.ql.parse.SemanticException:No valid privileges\n User hive does not have privileges for SWITCHDATABASE:21:5', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:postAnalyze:HiveAuthzBindingHook.java:387', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:424', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:305', 'org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1110', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1104', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:100', '*org.apache.hadoop.hive.ql.metadata.AuthorizationException:User hive does not have privileges for SWITCHDATABASE:23:2', 'org.apache.sentry.binding.hive.authz.HiveAuthzBinding:authorize:HiveAuthzBinding.java:275', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:authorizeWithHiveBindings:HiveAuthzBindingHook.java:577', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:postAnalyze:HiveAuthzBindingHook.java:372'], statusCode=3), operationHandle=None)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Below are the permissions on the folders&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;drwxrwxrwt   - hive hive          0 2016-01-22 07:54 /user/hive/warehouse/master
drwxrwxrwt   - hive hive          0 2016-04-25 06:36 /user/hive/warehouse/person_partition_sqoop_subdir
drwxrwxrwt   - hive hive          0 2016-04-25 06:50 /user/hive/warehouse/person_partition_staging
drwxrwxrwt   - hive hive          0 2016-04-25 07:26 /user/hive/warehouse/person_partition_virtual
drwxrwxrwt   - hive hive          0 2016-04-22 08:27 /user/hive/warehouse/practice.db&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can somebody please suggest, why i am not able to access &amp;nbsp;existing databases as hive user and not allowed to even create new databases when i have given 777 permissions on warehouse folder and sub-folders to &amp;nbsp;hive:hive.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2026 13:52:09 GMT</pubDate>
    <dc:creator>deep00</dc:creator>
    <dc:date>2026-04-21T13:52:09Z</dc:date>
    <item>
      <title>Hive metastore can not access existing databases after integrating with Sentry</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-metastore-can-not-access-existing-databases-after/m-p/40971#M28734</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using&amp;nbsp;&lt;SPAN&gt;Cloudera Express 5.5.1 on Ubuntu.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have enabled Sentry authorisation on Hive as per Cloudera documentation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When i log in to Hue using Hive user and choose Metastore. I don't see all my databases that were previosuly created. &amp;nbsp;All i see is 'Default' Database. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have Hadoop groups option enabled and "hive" is the group on hadoop&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have 777 set on &lt;EM&gt;/user/hive/warehouse&lt;/EM&gt; directory and sub-directories&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have placed the sentry-provider.ini under /user/hive/sentry directory and it looks like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[groups] 
# Assigns each Hadoop group to its set of roles  
hive= admin_role  

[roles] # The uris below define a define a landing skid which 
# the user can use to import or export data from the system. 
# Since the server runs as the user "hive" files in that directory 
# must either have the group hive and read/write set or 
# be world read/write. 
# http://www.cloudera.com/documentation/enterprise/5-5-x/topics/sg_hive_sql.html
# Implies everything on server1 and database
admin_role = server=server1-&amp;gt;db=practice&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When i try to create a new database, it get the below errors&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[18/May/2016 01:42:49 -0700] middleware   INFO     Processing exception: Bad status for request TExecuteStatementReq(confOverlay={}, sessionHandle=TSessionHandle(sessionId=THandleIdentifier(secret='\x19fx\x06&amp;gt;[F\xaf\xb6,\x8a\xe6r\xdd\xb6R', guid='a2_\xb54\xcaB\x15\x9d7\x00\xd7\xc5P$h')), runAsync=False, statement='USE `default`'):
TExecuteStatementResp(status=TStatus(errorCode=40000, errorMessage='Error while compiling statement: FAILED: SemanticException No valid privileges\n User hive does not have privileges for SWITCHDATABASE', sqlState='42000', infoMessages=['*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException No valid privileges\n User hive does not have privileges for SWITCHDATABASE:17:16', 'org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:326', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:102', 'org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:171', 'org.apache.hive.service.cli.operation.Operation:run:Operation.java:268', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:410', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatement:HiveSessionImpl.java:391', 'org.apache.hive.service.cli.CLIService:executeStatement:CLIService.java:245', 'org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:509', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1313', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1298', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:285', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1145', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:615', 'java.lang.Thread:run:Thread.java:745', '*org.apache.hadoop.hive.ql.parse.SemanticException:No valid privileges\n User hive does not have privileges for SWITCHDATABASE:21:5', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:postAnalyze:HiveAuthzBindingHook.java:387', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:424', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:305', 'org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1110', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1104', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:100', '*org.apache.hadoop.hive.ql.metadata.AuthorizationException:User hive does not have privileges for SWITCHDATABASE:23:2', 'org.apache.sentry.binding.hive.authz.HiveAuthzBinding:authorize:HiveAuthzBinding.java:275', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:authorizeWithHiveBindings:HiveAuthzBindingHook.java:577', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:postAnalyze:HiveAuthzBindingHook.java:372'], statusCode=3), operationHandle=None): Traceback (most recent call last):
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/transaction.py", line 371, in inner
    return func(*args, **kwargs)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/create_database.py", line 49, in create_database
    return execute_directly(request, query, on_success_url=reverse('metastore:databases'))
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/views.py", line 764, in execute_directly
    db.use(database)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/dbms.py", line 527, in use
    return self.client.use(query)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 938, in use
    data = self._client.execute_query(query)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 679, in execute_query
    return self.execute_query_statement(statement=query.query['query'], max_rows=max_rows, configuration=configuration)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 683, in execute_query_statement
    (results, schema), operation_handle = self.execute_statement(statement=statement, max_rows=max_rows, configuration=configuration, orientation=orientation)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 711, in execute_statement
    res = self.call(self._client.ExecuteStatement, req)
  File "/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hue/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 597, in call
    raise QueryServerException(Exception('Bad status for request %s:\n%s' % (req, res)), message=message)
QueryServerException: Bad status for request TExecuteStatementReq(confOverlay={}, sessionHandle=TSessionHandle(sessionId=THandleIdentifier(secret='\x19fx\x06&amp;gt;[F\xaf\xb6,\x8a\xe6r\xdd\xb6R', guid='a2_\xb54\xcaB\x15\x9d7\x00\xd7\xc5P$h')), runAsync=False, statement='USE `default`'):
TExecuteStatementResp(status=TStatus(errorCode=40000, errorMessage='Error while compiling statement: FAILED: SemanticException No valid privileges\n User hive does not have privileges for SWITCHDATABASE', sqlState='42000', infoMessages=['*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException No valid privileges\n User hive does not have privileges for SWITCHDATABASE:17:16', 'org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:326', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:102', 'org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:171', 'org.apache.hive.service.cli.operation.Operation:run:Operation.java:268', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:410', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatement:HiveSessionImpl.java:391', 'org.apache.hive.service.cli.CLIService:executeStatement:CLIService.java:245', 'org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:509', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1313', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1298', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:285', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1145', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:615', 'java.lang.Thread:run:Thread.java:745', '*org.apache.hadoop.hive.ql.parse.SemanticException:No valid privileges\n User hive does not have privileges for SWITCHDATABASE:21:5', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:postAnalyze:HiveAuthzBindingHook.java:387', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:424', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:305', 'org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1110', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1104', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:100', '*org.apache.hadoop.hive.ql.metadata.AuthorizationException:User hive does not have privileges for SWITCHDATABASE:23:2', 'org.apache.sentry.binding.hive.authz.HiveAuthzBinding:authorize:HiveAuthzBinding.java:275', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:authorizeWithHiveBindings:HiveAuthzBindingHook.java:577', 'org.apache.sentry.binding.hive.HiveAuthzBindingHook:postAnalyze:HiveAuthzBindingHook.java:372'], statusCode=3), operationHandle=None)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Below are the permissions on the folders&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;drwxrwxrwt   - hive hive          0 2016-01-22 07:54 /user/hive/warehouse/master
drwxrwxrwt   - hive hive          0 2016-04-25 06:36 /user/hive/warehouse/person_partition_sqoop_subdir
drwxrwxrwt   - hive hive          0 2016-04-25 06:50 /user/hive/warehouse/person_partition_staging
drwxrwxrwt   - hive hive          0 2016-04-25 07:26 /user/hive/warehouse/person_partition_virtual
drwxrwxrwt   - hive hive          0 2016-04-22 08:27 /user/hive/warehouse/practice.db&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can somebody please suggest, why i am not able to access &amp;nbsp;existing databases as hive user and not allowed to even create new databases when i have given 777 permissions on warehouse folder and sub-folders to &amp;nbsp;hive:hive.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 13:52:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-metastore-can-not-access-existing-databases-after/m-p/40971#M28734</guid>
      <dc:creator>deep00</dc:creator>
      <dc:date>2026-04-21T13:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hive metastore can not access existing databases after integrating with Sentry</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-metastore-can-not-access-existing-databases-after/m-p/40973#M28735</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please ignore my question, i have solved the issue by applying steps in the below resolved topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/t5/Security-Apache-Sentry/Hue-Sentry-tables-Tables-dissapear-when-enable-sentry-in-Hive/m-p/40755#M66" target="_blank"&gt;https://community.cloudera.com/t5/Security-Apache-Sentry/Hue-Sentry-tables-Tables-dissapear-when-enable-sentry-in-Hive/m-p/40755#M66&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 09:04:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-metastore-can-not-access-existing-databases-after/m-p/40973#M28735</guid>
      <dc:creator>deep00</dc:creator>
      <dc:date>2016-05-18T09:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Hive metastore can not access existing databases after integrating with Sentry</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-metastore-can-not-access-existing-databases-after/m-p/40980#M28736</link>
      <description>&lt;P&gt;It is always nice when someone solves their own issue. Even better when they discover it via another thread on the community. Thanks for the update. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 12:29:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-metastore-can-not-access-existing-databases-after/m-p/40980#M28736</guid>
      <dc:creator>cjervis</dc:creator>
      <dc:date>2016-05-18T12:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Hive metastore can not access existing databases after integrating with Sentry</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-metastore-can-not-access-existing-databases-after/m-p/46091#M28737</link>
      <description>&lt;P&gt;This should help:&amp;nbsp;&lt;A title="solution" href="http://www.yourtechchick.com/hadoop/no-databases-available-permissions-missing-error-hive-sentry/" target="_self"&gt;http://www.yourtechchick.com/hadoop/no-databases-available-permissions-missing-error-hive-sentry/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2016 08:02:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-metastore-can-not-access-existing-databases-after/m-p/46091#M28737</guid>
      <dc:creator>sim6</dc:creator>
      <dc:date>2016-10-09T08:02:43Z</dc:date>
    </item>
  </channel>
</rss>

