Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hive error on all queries: Couldn't find log associated with operation handle

Tags:

hadoop

hive

hue

Getting an error on all hive queries running on Hadoop.

Simply running a select statement from a table that exists and getting the following results:

Fetching results ran into the following error(s):

Couldn't find log associated with operation handle: 
OperationHandle[opType=EXECUTE_STATEMENT,
getHandleIdentifier()=263df9c3-c076-454f-a025-23f5b919e957]

And the accompaning logs for the query are:

Bad status for request TFetchResultsReq(fetchType=1, operationHandle=TOperationHandle(hasResultSet=False, modifiedRowCount=None, operationType=0, operationId=THandleIdentifier(secret='%\x1d\x0f\x11\xce\xf4B\xd6\xb8\xb5\x8ddv\xceKV', guid="\xbc5\xd9|\xfa\x13J'\x86\x8e4\xb3\x87\xa0\xf4\x05")), orientation=4, maxRows=-1): TFetchResultsResp(status=TStatus(errorCode=0, errorMessage="Couldn't find log associated with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=bc35d97c-fa13-4a27-868e-34b387a0f405]", sqlState=None, infoMessages=["*org.apache.hive.service.cli.HiveSQLException:Couldn't find log associated with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=bc35d97c-fa13-4a27-868e-34b387a0f405]:25:24", 'org.apache.hive.service.cli.operation.OperationManager:getOperationLogRowSet:OperationManager.java:257', 'org.apache.hive.service.cli.session.HiveSessionImpl:fetchResults:HiveSessionImpl.java:656', 'sun.reflect.GeneratedMethodAccessor29:invoke::-1', 'sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43', 'java.lang.reflect.Method:invoke:Method.java:606', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:79', 'org.apache.hive.service.cli.session.HiveSessionProxy:access$000:HiveSessionProxy.java:37', 'org.apache.hive.service.cli.session.HiveSessionProxy$1:run:HiveSessionProxy.java:64', 'java.security.AccessController:doPrivileged:AccessController.java:-2', 'javax.security.auth.Subject:doAs:Subject.java:415', 'org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1628', 'org.apache.hadoop.hive.shims.HadoopShimsSecure:doAs:HadoopShimsSecure.java:536', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:60', 'com.sun.proxy.$Proxy28:fetchResults::-1', 'org.apache.hive.service.cli.CLIService:fetchResults:CLIService.java:427', 'org.apache.hive.service.cli.thrift.ThriftCLIService:FetchResults:ThriftCLIService.java:587', '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.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:206', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1145', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:615', 'java.lang.Thread:run:Thread.java:744'], statusCode=3), results=None, hasMoreRows=None) Bad status for request TFetchResultsReq(fetchType=1, operationHandle=TOperationHandle(hasResultSet=False, modifiedRowCount=None, operationType=0, operationId=THandleIdentifier(secret='c\xdf\xfe\xb7\x8a\x10D\xea\xbaD\x93}B\xb5\xc3\xe7', guid='&=\xf9\xc3\xc0vEO\xa0%#\xf5\xb9\x19\xe9W')), orientation=0, maxRows=-1): TFetchResultsResp(status=TStatus(errorCode=0, errorMessage="Couldn't find log associated with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=263df9c3-c076-454f-a025-23f5b919e957]", sqlState=None, infoMessages=["*org.apache.hive.service.cli.HiveSQLException:Couldn't find log associated with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=263df9c3-c076-454f-a025-23f5b919e957]:25:24", 'org.apache.hive.service.cli.operation.OperationManager:getOperationLogRowSet:OperationManager.java:257', 'org.apache.hive.service.cli.session.HiveSessionImpl:fetchResults:HiveSessionImpl.java:656', 'sun.reflect.GeneratedMethodAccessor29:invoke::-1', 'sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43', 'java.lang.reflect.Method:invoke:Method.java:606', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:79', 'org.apache.hive.service.cli.session.HiveSessionProxy:access$000:HiveSessionProxy.java:37', 'org.apache.hive.service.cli.session.HiveSessionProxy$1:run:HiveSessionProxy.java:64', 'java.security.AccessController:doPrivileged:AccessController.java:-2', 'javax.security.auth.Subject:doAs:Subject.java:415', 'org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1628', 'org.apache.hadoop.hive.shims.HadoopShimsSecure:doAs:HadoopShimsSecure.java:536', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:60', 'com.sun.proxy.$Proxy28:fetchResults::-1', 'org.apache.hive.service.cli.CLIService:fetchResults:CLIService.java:427', 'org.apache.hive.service.cli.thrift.ThriftCLIService:FetchResults:ThriftCLIService.java:587', '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.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:206', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1145', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:615', 'java.lang.Thread:run:Thread.java:744'], statusCode=3), results=None, hasMoreRows=None) Bad status for request TFetchResultsReq(fetchType=1, operationHandle=TOperationHandle(hasResultSet=False, modifiedRowCount=None, operationType=0, operationId=THandleIdentifier(secret='c\xdf\xfe\xb7\x8a\x10D\xea\xbaD\x93}B\xb5\xc3\xe7', guid='&=\xf9\xc3\xc0vEO\xa0%#\xf5\xb9\x19\xe9W')), orientation=0, maxRows=-1): TFetchResultsResp(status=TStatus(errorCode=0, errorMessage="Couldn't find log associated with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=263df9c3-c076-454f-a025-23f5b919e957]", sqlState=None, infoMessages=["*org.apache.hive.service.cli.HiveSQLException:Couldn't find log associated with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=263df9c3-c076-454f-a025-23f5b919e957]:25:24", 'org.apache.hive.service.cli.operation.OperationManager:getOperationLogRowSet:OperationManager.java:257', 'org.apache.hive.service.cli.session.HiveSessionImpl:fetchResults:HiveSessionImpl.java:656', 'sun.reflect.GeneratedMethodAccessor29:invoke::-1', 'sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43', 'java.lang.reflect.Method:invoke:Method.java:606', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:79', 'org.apache.hive.service.cli.session.HiveSessionProxy:access$000:HiveSessionProxy.java:37', 'org.apache.hive.service.cli.session.HiveSessionProxy$1:run:HiveSessionProxy.java:64', 'java.security.AccessController:doPrivileged:AccessController.java:-2', 'javax.security.auth.Subject:doAs:Subject.java:415', 'org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1628', 'org.apache.hadoop.hive.shims.HadoopShimsSecure:doAs:HadoopShimsSecure.java:536', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:60', 'com.sun.proxy.$Proxy28:fetchResults::-1', 'org.apache.hive.service.cli.CLIService:fetchResults:CLIService.java:427', 'org.apache.hive.service.cli.thrift.ThriftCLIService:FetchResults:ThriftCLIService.java:587', '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.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:206', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1145', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:615', 'java.lang.Thread:run:Thread.java:744'], statusCode=3), results=None, hasMoreRows=None)

like image 769
Brian Doherty Avatar asked Aug 19 '15 08:08

Brian Doherty


3 Answers

If you are seeing this in a Cloudera distro when you use Hue, then add the following to the Hive Service Advanced Configuration Snippet (Safety Valve) for hive-site.xml in Cloudera Manager (or straight to the hive-site.xml for other distros):

<property>
    <name>hive.server2.logging.operation.enabled</name>
    <value>true</value>
</property>
like image 167
wazy Avatar answered Oct 21 '22 20:10

wazy


This error can happen with the i.e(“hive.server2.logging.operation.log.location”) is pointing to a location that does not exist to write logs.

Look at the code from OperationManager.java

OperationLog operationLog = getOperation(opHandle).getOperationLog();
if (operationLog == null) {
  throw new HiveSQLException("Couldn't find log associated with operation handle: " + opHandle);
}
like image 7
java_bee Avatar answered Oct 21 '22 19:10

java_bee


If you are using AWS EMR, then add the following to the hive-site.xml file at /etc/hive/conf.dist/hive-site.xml:

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

Then log into the master node and restart hue and hive server

sudo stop hive-server2
sudo stop hue
sudo start hue
sudo start hive-server2

This fixed it for me (tested in Release label emr-4.6.0).

like image 1
FirstName LastName Avatar answered Oct 21 '22 19:10

FirstName LastName