The task with id and allocation id doesn t exist – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch tries to perform an operation on a task with a specific id and allocation id, but it can’t find it. This could be due to the task being deleted, or it never existed in the first place. To resolve this issue, you can verify the existence of the task before performing operations on it. If the task is supposed to exist, check for any issues that might have led to its deletion. If the task is not supposed to exist, correct the operation to avoid referencing non-existent tasks.

This guide will help you check for common problems that cause the log ” the task with id {} and allocation id {} doesn’t exist ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: persistent, allocation, task.

Log Context

Log “the task with id {} and allocation id {} doesn’t exist” class name is PersistentTasksClusterService.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 if (tasksInProgress.hasTask(taskId)) {
 logger.warn("trying to update state on task {} with unexpected allocation id {}"; taskId; taskAllocationId);
 } else {
 logger.warn("trying to update state on non-existing task {}"; taskId);
 }
 throw new ResourceNotFoundException("the task with id {} and allocation id {} doesn't exist"; taskId; taskAllocationId);
 }
 }  @Override
 public void onFailure(Exception e) {

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?