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

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when you’re trying to access or manipulate a task in Elasticsearch using an ID that doesn’t correspond to any existing task. This could be due to a typo in the ID, or the task may have been deleted or never existed. To resolve this issue, you should first verify the task ID you’re using. If the ID is correct, check if the task was deleted or if it ever existed. If the task should exist but doesn’t, there may be a deeper issue with your Elasticsearch setup that needs investigation.

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

Log Context

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

 public ClusterState execute(ClusterState currentState) {
 PersistentTasksCustomMetadata.Builder tasksInProgress = builder(currentState);
 if (tasksInProgress.hasTask(id)) {
 return update(currentState; tasksInProgress.removeTask(id));
 } else {
 throw new ResourceNotFoundException("the task with id {} doesn't exist"; id);
 }  @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?