# Cannot delete index template

**URL:** <https://discuss.elastic.co/t/cannot-delete-index-template/243009>\
**Category:** Elasticsearch\
**Created:** [July 29, 2020, 7:08am UTC](https://discuss.elastic.co/t/cannot-delete-index-template/243009 "2020-07-29T07:08:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karel\_Cech](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karel_cech/32/46872_2.png) [@Karel\_Cech](https://discuss.elastic.co/u/Karel_Cech)\
**Post date:** [July 29, 2020, 7:08am UTC](https://discuss.elastic.co/t/cannot-delete-index-template/243009/1 "2020-07-29T07:08:47Z")

</div>

Hi,

I accidentally created 2 templates with the same name and same pattern.  
Unfortunately, I don't remember how this happened, because the API does not allow to create templates of same priority and same pattern. But I got there..  
Maybe one template was created with 7.6.2. We recently upgraded.

Anyway, I saw 2 duplicated templates "geoserveis-7.8.0" en `GET _cat/templates/`

I DELETEd the template, and one disappeared. The other is still there though:

`GET _cat/templates/?v&name=geoserveis-7.8.0 `

```
name index_patterns order version composed_of
geoserveis-7.8.0 [geoserveis-7.8.0-*] 1 []

```

Now it seems I cannot delete the other one:

`DELETE _template/geoserveis-7.8.0`

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "index_template_missing_exception",
        "reason" : "index_template [geoserveis-7.8.0] missing"
      }
    ],
    "type" : "index_template_missing_exception",
    "reason" : "index_template [geoserveis-7.8.0] missing"
  },
  "status" : 404
}

```

Template rules are not being applied to a index.  
How can I get rid of the "ghost" template geoserveis-7.8.0?

---

<div class="post-metadata">

**Author:** ![Karel\_Cech](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karel_cech/32/46872_2.png) [@Karel\_Cech](https://discuss.elastic.co/u/Karel_Cech)\
**Post date:** [July 29, 2020, 9:58am UTC](https://discuss.elastic.co/t/cannot-delete-index-template/243009/2 "2020-07-29T09:58:18Z")

</div>

OK, I got the endpoint wrong: since v7.8 it's

`DELETE _index_template/geoserveis-7.8.0`

😀

---

<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:** [August 26, 2020, 9:58am UTC](https://discuss.elastic.co/t/cannot-delete-index-template/243009/3 "2020-08-26T09:58:21Z")

</div>

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