# My reindex task disappears somehow after it is created

**URL:** <https://discuss.elastic.co/t/my-reindex-task-disappears-somehow-after-it-is-created/367198>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [September 26, 2024, 3:42pm UTC](https://discuss.elastic.co/t/my-reindex-task-disappears-somehow-after-it-is-created/367198 "2024-09-26T15:42:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdhao](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jdhao](https://discuss.elastic.co/u/jdhao)\
**Post date:** [September 26, 2024, 3:42pm UTC](https://discuss.elastic.co/t/my-reindex-task-disappears-somehow-after-it-is-created/367198/1 "2024-09-26T15:42:40Z")

</div>

Hi, I am using Elasticsearch cluster from the Elastic cloud. The version is 8.10.

I have this strange issue occured. We use the `reindex` API with ` wait_for_completion=False` to create a reindex task.

In the response, we get the task id and then check the status of this task. The first check was successful, but then I get the following error when we check the task status:

```auto
NotFoundError(404, 'resource_not_found_exception', "task [PNlPZtvCSBuygFva2Ybjzg:3540981] isn't running and hasn't stored its results

```

The code is something like this:

```auto
response = self.es.reindex(
    source=source,
    dest=dest,
    script=script,
    wait_for_completion=False
)
task_id = response['task']
logger.debug("Reindex task started: %s", task_id)

# Monitor progress
while True:
    # check status of the running task
    response = self.es.tasks.get(task_id=task_id)
    task_status = response['task']['status']
    doc_count_dst = task_status['created'] + task_status['updated'] + task_status['deleted']
    logger.debug("Reindex progress: %d", doc_count_dst)
    if response['completed']:
        break
    time.sleep(0.8)

```

I am 100% sure we didn't cancel the task or anything. Somehow the task disappears.

---

<div class="post-metadata">

**Author:** ![jdhao](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jdhao](https://discuss.elastic.co/u/jdhao)\
**Post date:** [September 26, 2024, 3:43pm UTC](https://discuss.elastic.co/t/my-reindex-task-disappears-somehow-after-it-is-created/367198/2 "2024-09-26T15:43:04Z")

</div>

Removed #elastic-cloud

---

<div class="post-metadata">

**Author:** ![jdhao](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jdhao](https://discuss.elastic.co/u/jdhao)\
**Post date:** [September 26, 2024, 3:43pm UTC](https://discuss.elastic.co/t/my-reindex-task-disappears-somehow-after-it-is-created/367198/3 "2024-09-26T15:43:41Z")

</div>

Removed #elastic-cloud
