Task cancelled due to reason – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.1-8.9

Briefly, this error occurs when a task in Elasticsearch is cancelled due to a specific reason such as a timeout, a node failure, or a manual cancellation. To resolve this issue, you can increase the timeout limit if it’s too short, ensure the health of your nodes, or check if the task was manually cancelled and prevent it from happening again. Also, monitor your cluster’s performance to avoid overloading, which can lead to task cancellations.

This guide will help you check for common problems that cause the log ” [{}] task cancelled due to reason [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, task.

Log Context

Log “[{}] task cancelled due to reason [{}]” classname is TrainedModelDeploymentTask.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :


    protected void onCancelled() {
        String reason = getReasonCancelled();
        logger.info("[{}] task cancelled due to reason [{}]"; getDeploymentId(); reason);
                acknowledgedResponse -> {};
                e -> logger.error(() -> "[" + getDeploymentId() + "] error stopping the deployment after task cancellation"; 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?