# Elasticsearch 7.16.2 Snapshot Status Error: 'duration cannot be negative'

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-16-2-snapshot-status-error-duration-cannot-be-negative/359721>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [May 17, 2024, 2:33pm UTC](https://discuss.elastic.co/t/elasticsearch-7-16-2-snapshot-status-error-duration-cannot-be-negative/359721 "2024-05-17T14:33:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anastasia\_Kornienko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anastasia_kornienko/32/134580_2.png) [@Anastasia\_Kornienko](https://discuss.elastic.co/u/Anastasia_Kornienko)\
**Post date:** [May 17, 2024, 2:33pm UTC](https://discuss.elastic.co/t/elasticsearch-7-16-2-snapshot-status-error-duration-cannot-be-negative/359721/1 "2024-05-17T14:33:22Z")

</div>

Hello,

I'm encountering an error when trying to check the status of a snapshot. The situation is as follows:

I have an Elasticsearch 7.16.2 cluster consisting of 5 nodes. One node is currently unavailable while a snapshot is being taken. When I attempt to check the snapshot status using the following command:

```auto
curl -X GET "localhost:9200/_snapshot/_status?pretty"

```

I get the following error:

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "duration cannot be negative, was given [-5349206]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason": "duration cannot be negative, was given [-5349206]"
  },
  "status" : 400
}

```

After some time, when the backup process completes, the snapshot status command works correctly.

Why does this error occur?

---

<div class="post-metadata">

**Author:** ![piergm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/piergm/32/130921_2.png) [@piergm](https://discuss.elastic.co/u/piergm)\
**Post date:** [May 23, 2024, 9:54am UTC](https://discuss.elastic.co/t/elasticsearch-7-16-2-snapshot-status-error-duration-cannot-be-negative/359721/2 "2024-05-23T09:54:22Z")

</div>

Hello @Anastasia_Kornienko,  
[from the docs](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/get-snapshot-api.html#get-snapshot-api-query-params) you can add the optional query parameter `ignore_unavailable=true` to your request and get more detailed information on what the failure is under the [failures](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/get-snapshot-api.html#get-snapshot-api-response-failures) section of the response.  
That should provide a human readable failure that I can help you resolve instead of an error.  
Hope this helps!

---

<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:** [May 23, 2024, 9:30pm UTC](https://discuss.elastic.co/t/elasticsearch-7-16-2-snapshot-status-error-duration-cannot-be-negative/359721/3 "2024-05-23T21:30:26Z")

</div>

You could also pass the `?error_trace` query parameter to get a stack trace which would show exactly where this exception is happening. However one possible explanation for this would be if you have nodes in your cluster with wildly incorrect local clocks. Try `GET _nodes/_all/stats/,?filter_path=nodes.*.timestamp,nodes.*.name` to see the current time in milliseconds on each node and look for outliers there.

---

<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:** [June 20, 2024, 9:30pm UTC](https://discuss.elastic.co/t/elasticsearch-7-16-2-snapshot-status-error-duration-cannot-be-negative/359721/4 "2024-06-20T21:30:52Z")

</div>

Closed on June 20, 2024, 9:30pm UTC

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