Task is not found – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.8-8.9

Briefly, this error occurs when Elasticsearch tries to access a task that doesn’t exist or has already been completed and removed from the task management index. This could be due to a delay in task execution or a premature request for task results. To resolve this issue, you can 1) ensure that the task ID is correct, 2) increase the wait time before requesting task results, or 3) check if the task has been completed before requesting its results.

This guide will help you check for common problems that cause the log ” task [{}] is not found ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: admin, node, task, cluster.

Log Context

Log “task [{}] is not found” class name is TransportCancelTasksAction.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 } else {
 if (taskManager.getTask(request.getTargetTaskId().getId()) != null) {
 // The task exists; but doesn't support cancellation
 throw new IllegalArgumentException("task [" + request.getTargetTaskId() + "] doesn't support cancellation");
 } else {
 throw new ResourceNotFoundException("task [{}] is not found"; request.getTargetTaskId());
 } else {
 final var tasks = new ArrayList();
 for (CancellableTask task : taskManager.getCancellableTasks().values()) {