# Elasticsearch delete snapshot, 504 timeout

**URL:** <https://discuss.elastic.co/t/elasticsearch-delete-snapshot-504-timeout/266532>\
**Category:** Elasticsearch\
**Created:** [March 8, 2021, 10:22am UTC](https://discuss.elastic.co/t/elasticsearch-delete-snapshot-504-timeout/266532 "2021-03-08T10:22:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Norman\_Khine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/norman_khine/32/3342_2.png) [@Norman\_Khine](https://discuss.elastic.co/u/Norman_Khine)\
**Post date:** [March 8, 2021, 10:22am UTC](https://discuss.elastic.co/t/elasticsearch-delete-snapshot-504-timeout/266532/1 "2021-03-08T10:22:01Z")

</div>

Hello,  
I am taking snapshots and saving these to AWS S3, when I try to delete old snapshots, I get

```auto
curl -X DELETE "http://localhost:9300/_snapshot/backup-prod/20200123031645?pretty"  ✔  10089  09:20:30 
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>

```

i see there is no `wait_for_completion` available for this endpoint - [Task management API | Elasticsearch Reference [7.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html#_wait_for_completion~)

any advice on how to resolve this, is much appreciated.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 8, 2021, 11:01am UTC](https://discuss.elastic.co/t/elasticsearch-delete-snapshot-504-timeout/266532/2 "2021-03-08T11:01:36Z")

</div>

Elasticsearch is not returning this error, it's coming from something else in your system applying an unnecessary timeout. The best fix is to remove that timeout. Alternatively you can ignore the error, since the operation will continue in the background. If you like, you can retry it too.

---

<div class="post-metadata">

**Author:** ![Norman\_Khine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/norman_khine/32/3342_2.png) [@Norman\_Khine](https://discuss.elastic.co/u/Norman_Khine)\
**Post date:** [March 8, 2021, 12:27pm UTC](https://discuss.elastic.co/t/elasticsearch-delete-snapshot-504-timeout/266532/3 "2021-03-08T12:27:57Z")

</div>

> [@DavidTurner](#):
>
> Elasticsearch is not returning this error, it's coming from something else in your system applying an unnecessary timeout. The best fix is to remove that timeout. Alternatively you can ignore the error, since the operation will continue in the background. If you like, you can retry it too.

When retrying I get an error:

```auto
cannot delete - another snapshot is currently being deleted

```

So just to confirm, I have quite a lot old snapshots that I want to delete, so when sending

```auto
curl -X DELETE "http://localhost:9300/_snapshot/backup-prod/20200123*?pretty"

```

command, i can ignore the timeout error, but as snapshot status endpoint only returns an object when there is a snapshot being taken or if it's being restored.

it's empty if the snapshot is being deleted and there is no other endpoint to track snapshot deletion operations specifically.

how do i track the snapshot delete progress?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 8, 2021, 12:37pm UTC](https://discuss.elastic.co/t/elasticsearch-delete-snapshot-504-timeout/266532/4 "2021-03-08T12:37:26Z")

</div>

Just to reiterate, the real problem is a bad timeout somewhere else in your system, which you can't fix within Elasticsearch. I strongly recommend addressing that rather than trying to work around it.

> [@Norman\_Khine](#):
>
> `another snapshot is currently being deleted`

This message is also not coming from Elasticsearch, and Elasticsearch 7.11 will let you try and delete the same snapshot twice. You should be able to retry the delete until it either succeeds or indicates that the snapshot was not found.

---

<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:** [April 5, 2021, 12:37pm UTC](https://discuss.elastic.co/t/elasticsearch-delete-snapshot-504-timeout/266532/5 "2021-04-05T12:37:59Z")

</div>

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