# "no shard follow tasks" when pausing following on follower index

**URL:** <https://discuss.elastic.co/t/no-shard-follow-tasks-when-pausing-following-on-follower-index/207074>\
**Category:** Elasticsearch\
**Tags:** ccr-cross-cluster-replication\
**Created:** [November 8, 2019, 8:56am UTC](https://discuss.elastic.co/t/no-shard-follow-tasks-when-pausing-following-on-follower-index/207074 "2019-11-08T08:56:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kley/32/43533_2.png) [@kley](https://discuss.elastic.co/u/kley)\
**Post date:** [November 8, 2019, 8:56am UTC](https://discuss.elastic.co/t/no-shard-follow-tasks-when-pausing-following-on-follower-index/207074/1 "2019-11-08T08:56:27Z")

</div>

👋 everyone!

We are using CCR (elasticsearch v 6.8.x) for quite a time now to run in code where we automatically delete old indices.  
The documentation states: `The follower index must be paused and closed before invoking the unfollow API.` (see: [unfollow API documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html#ccr-post-unfollow-desc))

So, our worker kicks in and starts to invoke the pause API for a follower index, unsuccessfully.

```auto
method [POST], host [http://10.176.x.139:9200], URI [/ccr-visit.../_ccr/pause_follow], status line [HTTP/1.1 400 Bad Request]
{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "no shard follow tasks for [ccr-visit...]"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "no shard follow tasks for [ccr-visit...]"
    },
    "status": 400
}

```

No logs on elastic side though.  
Maybe it's worth noting, that the leader index got created - therefore also the follower - but never got data written to.

Is there a way to prevent this message, or is this expected for empty follower indices?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![nhat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nhat/32/22170_2.png) [@nhat](https://discuss.elastic.co/u/nhat)\
**Post date:** [November 8, 2019, 4:31pm UTC](https://discuss.elastic.co/t/no-shard-follow-tasks-when-pausing-following-on-follower-index/207074/2 "2019-11-08T16:31:08Z")

</div>

Hi @kley,

Did you delete a follower index before pausing? If yes, you can safely ignore the error. We can improve the error handling for this situation. With [https://github.com/elastic/elasticsearch/pull/44702](https://github.com/elastic/elasticsearch/pull/44702), CCR should automatically unfollow if a follower index gets deleted. Ideally, we should pause, close, and unfollow before deleting a follower index.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![nhat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nhat/32/22170_2.png) [@nhat](https://discuss.elastic.co/u/nhat)\
**Post date:** [November 8, 2019, 5:47pm UTC](https://discuss.elastic.co/t/no-shard-follow-tasks-when-pausing-following-on-follower-index/207074/3 "2019-11-08T17:47:33Z")

</div>

I opened [https://github.com/elastic/elasticsearch/pull/48915](https://github.com/elastic/elasticsearch/pull/48915) to return a more appropriate error message.

---

<div class="post-metadata">

**Author:** ![kley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kley/32/43533_2.png) [@kley](https://discuss.elastic.co/u/kley)\
**Post date:** [November 11, 2019, 7:08am UTC](https://discuss.elastic.co/t/no-shard-follow-tasks-when-pausing-following-on-follower-index/207074/4 "2019-11-11T07:08:16Z")

</div>

Hey Nhat!  
No I did not delete the index at all. It's still there.  
So, I invoked `_cat` to show all indices and that this particular index is still there and then called the `pause` API which returns this error:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/b/2b5559b407c9f2d5ea44137c2c8b64834c2c4b44.png)

---

<div class="post-metadata">

**Author:** ![nhat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nhat/32/22170_2.png) [@nhat](https://discuss.elastic.co/u/nhat)\
**Post date:** [November 11, 2019, 1:49pm UTC](https://discuss.elastic.co/t/no-shard-follow-tasks-when-pausing-following-on-follower-index/207074/5 "2019-11-11T13:49:54Z")

</div>

Hi @kley,

Was there any master failover in the follower cluster? Can you share the cluster state of the follower cluster (to my email)? Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 9, 2019, 1:49pm UTC](https://discuss.elastic.co/t/no-shard-follow-tasks-when-pausing-following-on-follower-index/207074/6 "2019-12-09T13:49:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
