Help Center/ MapReduce Service/ Troubleshooting/ Using Hive/ Hive Task Failed to Run on the Client but Successful on Yarn
Updated on 2024-09-18 GMT+08:00

Hive Task Failed to Run on the Client but Successful on Yarn

Symptom

When a Hive task fails to be executed, an error message similar to the following is displayed on the client:

Error:Invalid OperationHandler:OperationHander [opType=EXECUTE_STATEMENT,getHandleIdentifier()=XXX](state=,code=0)

However, the MapReduce task that is submitted by the task to Yarn is successfully executed.

Cause Analysis

The cluster where the error occurs has two HiveServer instances. The error in the log of one HiveServer instance is the same as the error (Error: Invalid OperationHandler) reported on the client. In the log of the other HiveServer instance, START_UP information similar to the following is printed when the error occurs, which indicates that the process is killed and restarted during that time. Because the HiveServer instance the task process plans to connect to is killed, it connects to the other healthy one, causing the error.
2017-02-15 14:40:11,309 | INFO  | main | STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting HiveServer2
STARTUP_MSG:   host = XXX-120-85-154/XXX.120.85.154
STARTUP_MSG:   args = []
STARTUP_MSG:   version = 1.3.0

Solution

Submit the task again and ensure that the HiveServer process is not manually restarted during task execution.