How To Solve Issues Related to Log – The task with id was found but it has a different allocation id ; status is not updated

Improve Your Elasticsearch Configuration

No Installation Required
No Security Risk
3 Free Minute Process !

No Installation

Updated: Jan-20

In-Page Navigation (click to jump) :

Opster Offer’s World-Class Elasticsearch Expertise In One Powerful Product
Try Our Free Elasticsearch Check-Up   Fix Painful Mistakes !

Troubleshooting background

To troubleshoot Elasticsearch log “The task with id was found but it has a different allocation id ; status is not updated” it’s important to understand common problems related to Elasticsearch concepts: allocation, cluster, persistent, task. See detailed explanations below complete with common problems, examples and useful tips.

Cluster in Elasticsearch

What is it

In Elasticsearch a cluster is a collection of one or more nodes (servers / VMs). A cluster can consist of an unlimited number of nodes. The cluster provides interface for indexing and storing data and search capability across all of the data which is stored in the data nodes

Each cluster has a single master node that is elected by the master eligible nodes. In cases where the master is not available the other connected master eligible nodes elect a new master. Clusters are identified by a unique name, which defaults to “Elasticsearch”.

Persistent in Elasticsearch

What it is

In Elasticsearch, Persistent refers to cluster settings that persist across cluster restarts. This setting is used in Cluster Update API calls. Persistent settings can also be configured in elasticsearch.yml file.

Examples
## enable shard routing
PUT /_cluster/settings
{
    "persistent" : {
        "cluster.routing.allocation.enable" : "all"
    }
}
## enable rebalancing of shards
PUT /_cluster/settings
{
    "persistent" : {
        "cluster.routing.rebalance.enable" : "all"
    }
}
## limit the heap size for fielddata
PUT /_cluster/settings
{
    "persistent" : {
                 “indices.breaker.fielddata.limit”: "30%"
    }
}


To help troubleshoot related issues we have gathered selected Q&A from the community and issues from Github , please review the following for further information :

1 Github Issue Number 37545  

2Github Issue Number 26293  


Log Context

Log ”The task [{}] with id [{}] was found but it has a different allocation id [{}]; status is not updated” classname is PersistentTasksClusterService.java
We have extracted the following from Elasticsearch source code to get an in-depth context :

                 if (tasksInProgress.hasTask(id; allocationId)) {
                    tasksInProgress.removeTask(id);
                    return update(currentState; tasksInProgress);
                } else {
                    if (tasksInProgress.hasTask(id)) {
                        logger.warn("The task [{}] with id [{}] was found but it has a different allocation id [{}]; status is not updated";
                                PersistentTasksCustomMetaData.getTaskWithId(currentState; id).getTaskName(); id; allocationId);
                    } else {
                        logger.warn("The task [{}] wasn't found; status is not updated"; id);
                    }
                    throw new ResourceNotFoundException("the task with id [" + id + "] and allocation id [" + allocationId + "] not found");






About Opster

Opster identifies and predicts root causes of Elasticsearch problems, provides recommendations and can automatically perform various actions to prevent issues, optimize performance and save resources.

Learn more: Glossary | Blog| Troubleshooting guides | Error Repository

Need help with any Elasticsearch issue ? Contact Opster