# DELETE index command returns varying JSON objects

**URL:** <https://discuss.elastic.co/t/delete-index-command-returns-varying-json-objects/345410>\
**Category:** Elasticsearch\
**Created:** [October 19, 2023, 5:55pm UTC](https://discuss.elastic.co/t/delete-index-command-returns-varying-json-objects/345410 "2023-10-19T17:55:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrodent](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mrodent](https://discuss.elastic.co/u/mrodent)\
**Post date:** [October 19, 2023, 5:55pm UTC](https://discuss.elastic.co/t/delete-index-command-returns-varying-json-objects/345410/1 "2023-10-19T17:55:37Z")

</div>

(ES 8.6.2, W10)

In Insomnia, when I try to delete an non-existent index, using command DELETE and url [https://localhost:9500/my\_test\_index](https://localhost:9500/my_test_index), I always seem to get a JSON object like this:

```
{
	"error": {
		"root_cause": [
    ...
	"status": 404
}

```

Similarly when I do the above in Python, using `requests`, I get the above response.

But when I run a `reqwest` request (in Rust) doing that same request I sometimes get the above but often get this:

```
{
    "acknowledged": true
}

```

The reason I'm doing this is to delete the index if it exists. Either 200 or 404 would therefore be acceptable status codes. But if I get "acknowledged", true or false, I don't know what that means: it's `true` even if the index doesn't exist.

This is all happening on a local machine, with one shard. At the current time there are no other indices in my shard. When I create this index, it has a yellow status. So my server/shard seem to be healthy enough.

Can anyone suggest why this might be happening? Might "acknowledged" mean in this case that the server is busy (on a previous command)? Is it possible that Rust's `reqwest` code works faster than Python?

---

<div class="post-metadata">

**Author:** ![mrodent](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mrodent](https://discuss.elastic.co/u/mrodent)\
**Post date:** [October 20, 2023, 6:03pm UTC](https://discuss.elastic.co/t/delete-index-command-returns-varying-json-objects/345410/2 "2023-10-20T18:03:02Z")

</div>

It seems I'm unable to edit this post.

If I get this { "acknowledged": true } and then repeat the command (whether or not after waiting for 1 ms), it seems that I always get the expected type of response (with "status" key) on the second attempt.

It's funny how this only seems to occur using Rust, not Python. I wonder what the explanation can be. Reading around I see _some_ stuff about "nodes" possibly taking time to respond in the kind of way you expect. Quite strange: would like to know if an expert can suggest what might be going on.

---

<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:** [November 17, 2023, 6:03pm UTC](https://discuss.elastic.co/t/delete-index-command-returns-varying-json-objects/345410/3 "2023-11-17T18:03:53Z")

</div>

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