Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

Hue- Hive error

New Contributor

I am getting the error when running the query 'Select * from table'


Fetching results ran into the following error(s):

Bad status for request TFetchResultsReq(fetchType=0, operationHandle=TOperationHandle(hasResultSet=True, modifiedRowCount=None, operationType=0, operationId=THandleIdentifier(secret='\x85\x8b5\xa3\xd5\xe3N\xf6\x9a8t>5s\x8e\xd8', guid='v"\xf5\xdd\xf6>J\xc7\x98\x16K\xeau\x81C+')), orientation=4, maxRows=100): TFetchResultsResp(status=TStatus(errorCode=0, errorMessage='Invalid OperationHandle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=7622f5dd-f63e-4ac7-9816-4bea7581432b]', sqlState=None, infoMessages=['*org.apache.hive.service.cli.HiveSQLException:Invalid OperationHandle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=7622f5dd-f63e-4ac7-9816-4bea7581432b]:12:11', '', '', '', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$', '', '', 'org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$', 'org.apache.thrift.server.TThreadPoolServer$', '', 'java.util.concurrent.ThreadPoolExecutor$', ''], statusCode=3), results=None, hasMoreRows=None)


But able to get the result when I am running the same query from hive CLI and after invalidating running from impala also..


Environment Details:

cdh 5.7.1



Master Guru



This type of error can have various causes, but there are a few things to do before troubleshooting this much further:




Restart Hue and Hive services to make sure that HiveServer2 is talking to the Metastore properly and that any Hive sessions are cleared out.


If the problem still occcurs continue on...




Test with beeline. Hue talks to HiveServer2 and the exception you showed is returned by HiveServer2.  If you use the deprecated "hive" CLI, that communicates with the Metastore directly and impala-shell communicates with the daemon.  Testing with beeline will be a more accurate indicator of the HiveServer2 health.  Testing with Impala and hive CLI shows that the metastore is functioning, but now we need to determine if HiveServer2 seems to be ok.


Let us know the command you ran and the results

Super Guru
Are you using Impala HA with a Load Balancer?


Hi in my case query executed OK in beeline....


this is the log of HIVE:


2020-03-25 23:55:23,529 WARN  org.apache.hive.service.cli.thrift.ThriftCLIService: [HiveServer2-Handler-Pool: Thread-147]: Error fetching results:
org.apache.hive.service.cli.HiveSQLException: Invalid OperationHandle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=c6841f7f-c591-4d3f-be44-c328a86a0774]
        at org.apache.hive.service.cli.operation.OperationManager.getOperation(
        at org.apache.hive.service.cli.CLIService.fetchResults(
        at org.apache.hive.service.cli.thrift.ThriftCLIService.FetchResults(
        at org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(
        at org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(
        at org.apache.thrift.ProcessFunction.process(
        at org.apache.thrift.TBaseProcessor.process(
        at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor.process(
        at org.apache.thrift.server.TThreadPoolServer$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$


New Contributor



I got the same error in hue 3.1.0. The sql works fine with beeline but will get same error with hue. And we're also using impala hive HA.


Tried [Set use_get_log_api=true in the beeswax section ], and it's not working. Do you have any other solution?


Can you verify where you logs are pointing .


also verify this in your hive-site.xml and make sure that value is true .


The above should help you.


also for fruther information refer this link