Support Questions

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

Hue- Hive error

avatar
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.operation.OperationManager:getOperation:OperationManager.java:170', 'org.apache.hive.service.cli.CLIService:fetchResults:CLIService.java:438', 'org.apache.hive.service.cli.thrift.ThriftCLIService:FetchResults:ThriftCLIService.java:689', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults:getResult:TCLIService.java:1553', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults:getResult:TCLIService.java:1538', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor:process:HadoopThriftAuthBridge.java:718', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:285', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1142', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:617', 'java.lang.Thread:run:Thread.java:745'], 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

hive-1.1.0

5 REPLIES 5

avatar
Master Guru

Hello,

 

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

 

(1)

 

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

 

(2)

 

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

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

avatar
Explorer

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(OperationManager.java:177)
        at org.apache.hive.service.cli.CLIService.fetchResults(CLIService.java:462)
        at org.apache.hive.service.cli.thrift.ThriftCLIService.FetchResults(ThriftCLIService.java:694)
        at org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(TCLIService.java:1553)
        at org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(TCLIService.java:1538)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
        at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor.process(HadoopThriftAuthBridge.java:747)
        at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748

 

avatar
New Contributor

Hi,

 

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?

avatar
Champion

Can you verify where you logs are pointing .

 

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

<property>
    <name>hive.server2.logging.operation.enabled</name>
    <value>true</value>
</property

The above should help you.

 

also for fruther information refer this link 

https://cwiki.apache.org/confluence/display/Hive/AdminManual+Configuration#AdminManualConfiguration-...