# Index and Alias name exact name

**URL:** https://discuss.elastic.co/t/index-and-alias-name-exact-name/320989
**Category:** Elasticsearch
**Created:** [December 12, 2022, 3:24am UTC](https://discuss.elastic.co/t/index-and-alias-name-exact-name/320989 "2022-12-12T03:24:16Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![QuestBevan](https://avatars.discourse-cdn.com/v4/letter/q/858c86/32.png) [@QuestBevan](https://discuss.elastic.co/u/QuestBevan)
#### Post date: [December 12, 2022, 3:24am UTC](https://discuss.elastic.co/t/index-and-alias-name-exact-name/320989/1 "2022-12-12T03:24:16Z")

</div>

Hi,

An index and alias with the exact same name was accidently created and now our Elasticsearch node won't connect to our cluster. Luckily only 1 node was restarted before we read a support article saying DO NOT restart any nodes. I am hoping someone here can help me resolve before Elastic support reply (4 hours SLA).

Hoping this post will help people in the future. Couldn't find anything similar in the forum.

I have tried

```auto
POST /_aliases
{
  "actions": [
    {
      "remove": {
        "index": "*",
        "alias": "q_mqtt_devices"
      }
    }
  ]
}

```

and this results in

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "aliases_not_found_exception",
        "reason": "aliases [q_mqtt_devices] missing",
        "resource.type": "aliases",
        "resource.id": "q_mqtt_devices"
      }
    ],
    "type": "aliases_not_found_exception",
    "reason": "aliases [q_mqtt_devices] missing",
    "resource.type": "aliases",
    "resource.id": "q_mqtt_devices"
  },
  "status": 404
}

```

Trying this also

```auto
DELETE q_mqtt_devices/_alias/q_mqtt_devices

```

Results in

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "The provided expression [q_mqtt_devices] matches an alias, specify the corresponding concrete indices instead."
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "The provided expression [q_mqtt_devices] matches an alias, specify the corresponding concrete indices instead."
  },
  "status": 400
}

```

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 12, 2022, 5:53am UTC](https://discuss.elastic.co/t/index-and-alias-name-exact-name/320989/2 "2022-12-12T05:53:54Z")

</div>

What version of Elasticsearch are you using? You should always state this as the answer may depend on version.

Have you tried removing the alias the same way you added it:

```auto
POST _aliases
{
  "actions": [
    {
      "remove": {
        "index": "q_mqtt_devices",
        "alias": "q_mqtt_devices"
      }
    }
  ]
}

```

---

<div class="post-metadata">

### Author: ![QuestBevan](https://avatars.discourse-cdn.com/v4/letter/q/858c86/32.png) [@QuestBevan](https://discuss.elastic.co/u/QuestBevan)
#### Post date: [December 12, 2022, 6:20am UTC](https://discuss.elastic.co/t/index-and-alias-name-exact-name/320989/3 "2022-12-12T06:20:39Z")

</div>

Tried this but this has not worked. Running 8.5.0

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 12, 2022, 6:38am UTC](https://discuss.elastic.co/t/index-and-alias-name-exact-name/320989/4 "2022-12-12T06:38:18Z")

</div>

OK, then I suspect support may need to get involved. The fact that using a wildcard for index name when creating an alias allows an alias with the same name as an existing index to be created sounds like a validation bug, so I would recommend opening an issue on Github to fix this.

---

<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: [December 12, 2022, 8:54am UTC](https://discuss.elastic.co/t/index-and-alias-name-exact-name/320989/5 "2022-12-12T08:54:23Z")

</div>

This is a known issue in 8.5.0 and an upgrade to 8.5.3 will fix it:

> <https://github.com/elastic/elasticsearch/pull/91887>
>
> Follow up to #91456 implementing an automated fix for indices corrupted in 8.5.
> …
> 
> Not sure this should get an automated test, could write one that corrupts the index in 8.5 and then does a rolling upgrade but maybe manually testing this is good enough in this case?

---

<div class="post-metadata">

### Author: ![QuestBevan](https://avatars.discourse-cdn.com/v4/letter/q/858c86/32.png) [@QuestBevan](https://discuss.elastic.co/u/QuestBevan)
#### Post date: [December 12, 2022, 9:29am UTC](https://discuss.elastic.co/t/index-and-alias-name-exact-name/320989/6 "2022-12-12T09:29:11Z")

</div>

Thank you again David

---

<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: [January 9, 2023, 9:29am UTC](https://discuss.elastic.co/t/index-and-alias-name-exact-name/320989/7 "2023-01-09T09:29:38Z")

</div>

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