# Index not found exception when getting template

**URL:** https://discuss.elastic.co/t/index-not-found-exception-when-getting-template/75063
**Category:** Elasticsearch
**Created:** [February 14, 2017, 3:05pm UTC](https://discuss.elastic.co/t/index-not-found-exception-when-getting-template/75063 "2017-02-14T15:05:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jason26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason26/32/54948_2.png) [@jason26](https://discuss.elastic.co/u/jason26)
#### Post date: [February 14, 2017, 3:05pm UTC](https://discuss.elastic.co/t/index-not-found-exception-when-getting-template/75063/1 "2017-02-14T15:05:12Z")

</div>

I'm running into an issue where a request like "curl [http://elasticsearch:9200/\_template/logstash](http://elasticsearch:9200/_template/logstash)" is returning the following response body:

```
{"error":{"index":"","index_uuid":"_na_","reason":"no such index","resource.id":"","resource.type":"index_expression","root_cause":[{"index":"","index_uuid":"_na_","reason":"no such index","resource.id":"","resource.type":"index_expression","type":"index_not_found_exception"}],"type":"index_not_found_exception"},"status":404} 

```

Can anyone tell me why this would happen? The requested template does exist, and this error does appear to be a bit random when it happens. Sometimes the template is fetched, other times its not.

I compared it to the error return when fetching a template that does not exist, and that returns an empty body, not the above.

Thanks.

---

<div class="post-metadata">

### Author: ![tanguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy/32/6030_2.png) [@tanguy](https://discuss.elastic.co/u/tanguy)
#### Post date: [February 14, 2017, 3:30pm UTC](https://discuss.elastic.co/t/index-not-found-exception-when-getting-template/75063/2 "2017-02-14T15:30:19Z")

</div>

Hi,

Can you please share the Elasticsearch logs when such error happens? Thanks

---

<div class="post-metadata">

### Author: ![jason26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason26/32/54948_2.png) [@jason26](https://discuss.elastic.co/u/jason26)
#### Post date: [February 14, 2017, 4:31pm UTC](https://discuss.elastic.co/t/index-not-found-exception-when-getting-template/75063/3 "2017-02-14T16:31:47Z")

</div>

> <http://pastebin.com/raw/PpsQM8Kn>

---

<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: [March 14, 2017, 4:31pm UTC](https://discuss.elastic.co/t/index-not-found-exception-when-getting-template/75063/4 "2017-03-14T16:31:48Z")

</div>

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