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

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


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>


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);}


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-server2sudo stop huesudo start huesudo start hive-server2

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