﻿---
title: Stuck task
description: Describes what AutoOps detects and surfaces with the Stuck task insight: One or more cluster tasks have run longer than your configured stuck-task threshold.
url: https://www.elastic.co/docs/reference/autoops-insights/elasticsearch/stuck_task
products:
  - Elastic Cloud Enterprise
  - Elastic Cloud Hosted
  - Elastic Cloud on Kubernetes
  - Elasticsearch
applies_to:
  - Elastic Cloud Hosted: Generally available
  - Elastic Cloud on Kubernetes: Generally available
  - Elastic Cloud Enterprise: Generally available
  - Self-managed Elastic deployments: Generally available
---

# Stuck task
One or more cluster tasks have run longer than your configured stuck-task threshold. Long reindex, update-by-query, delete-by-query, or snapshot work can be legitimate on large datasets, but tasks that never finish can hold cluster state and stress nodes.
<note>
  For a complete list of insights, refer to [AutoOps insights](https://www.elastic.co/docs/reference/autoops-insights/elasticsearch).
</note>


## Insight details


| Field     | Value                         |
|-----------|-------------------------------|
| Component | Elasticsearch                 |
| Severity  | Medium                        |
| Scope     | Node                          |
| Domains   | performance, stability, tasks |


## Example: What you might see in AutoOps

The following is an example of what you might see when this insight is triggered. Real insights use live data and links from your deployment or cluster.

### Stuck task


#### What was detected

There are 3 tasks that ran more than the 12 minutes threshold.
The longest task running start time was 2026-03-15T14:22:00 UTC time.
The longest task running time is 48 minutes.

#### Recommendations

<note>
  AutoOps shows different recommendations depending on how their conditions match your deployment or cluster.
</note>

<dropdown title="Cancel long-running tasks">
  **Condition**: Shown when cancellable.Cancel long-running tasks (es-data-01:4521, es-data-02:7788) that are affecting cluster stability. Use the action below.
  ```json
  ```

  <note>
    Requires the `manage cluster` privilege. Requires Elasticsearch 8.0.0 or later. This action changes cluster or index configuration.
  </note>
</dropdown>

<dropdown title="Fix non-cancellable stuck tasks">
  **Condition**: Shown when not cancellable.Restart the nodes running the stuck tasks to clear them.
</dropdown>


#### Background and impact

Elasticsearch tracks long-running work such as reindex, update-by-query, delete-by-query, and snapshot operations as cluster tasks. Large datasets or heavy resource use can legitimately extend runtime, but tasks that stop making progress hold cluster state and consume node resources.
Stuck tasks often follow shard assignment problems, repository or network issues during snapshots, or master node resource pressure. If they persist, cluster performance and stability can suffer until the underlying work completes or is cleared.