# Previously working index failing to create

**URL:** https://discuss.elastic.co/t/previously-working-index-failing-to-create/35927
**Category:** Elasticsearch
**Created:** [November 30, 2015, 4:22pm UTC](https://discuss.elastic.co/t/previously-working-index-failing-to-create/35927 "2015-11-30T16:22:16Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![TheWinterWizard](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@TheWinterWizard](https://discuss.elastic.co/u/TheWinterWizard)
#### Post date: [November 30, 2015, 4:22pm UTC](https://discuss.elastic.co/t/previously-working-index-failing-to-create/35927/1 "2015-11-30T16:22:16Z")

</div>

Our production ELK stack suddenly stopped being able to create indexes for exceptions recently.  
We're using the NEST C# library in the application, and events (purchases, site activity) are still able to create indexes, which is done with identical code (minus the index name and object being passed).

Elasticsearch logs say: [http://pastebin.com/1XA2Kavb](http://pastebin.com/1XA2Kavb)

I can't recreate the issue in my dev environment (logs everything just fine), which tells me the issue isn't in the application code (which I'll paste below anyway). I recently tried putting a template, which I believe is when the issue started, and attempts to clear it didn't seem to fix the issue. Ideally I'd be able to fix this without a restart, some googling tells me that may have to happen. Any ideas? I'm happy to provide any other information that would be helpful.

Here's the c# snippet:  
`var index = client.Index(elkception, i => i .Index("exceptions-" + DateTime.Now.ToString("yyyy-MM-dd")) .Type(elkception.TypeOfException) .Refresh() .Ttl("1m") );`

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [November 30, 2015, 5:33pm UTC](https://discuss.elastic.co/t/previously-working-index-failing-to-create/35927/2 "2015-11-30T17:33:49Z")

</div>

There seems to be a problem with the date format that you are providing in your mappings. Can you provide us with your mappings?

---

<div class="post-metadata">

### Author: ![TheWinterWizard](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@TheWinterWizard](https://discuss.elastic.co/u/TheWinterWizard)
#### Post date: [November 30, 2015, 5:52pm UTC](https://discuss.elastic.co/t/previously-working-index-failing-to-create/35927/3 "2015-11-30T17:52:47Z")

</div>

That's what the c# snippet was for. It just concatenates "exceptions-" with the date in yyyy-MM-dd format.  
`.Index("exceptions-" + DateTime.Now.ToString("yyyy-MM-dd"))`

Unless I'm totally misunderstanding you

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [November 30, 2015, 6:16pm UTC](https://discuss.elastic.co/t/previously-working-index-failing-to-create/35927/4 "2015-11-30T18:16:32Z")

</div>

The issue seems to imply that there is a template that has a typo in some date format. Can you provide us with the output of `curl -XGET localhost:9200/_template/`?

---

<div class="post-metadata">

### Author: ![TheWinterWizard](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@TheWinterWizard](https://discuss.elastic.co/u/TheWinterWizard)
#### Post date: [November 30, 2015, 6:23pm UTC](https://discuss.elastic.co/t/previously-working-index-failing-to-create/35927/5 "2015-11-30T18:23:13Z")

</div>

Hmm, well there is an exceptions-daily template that I thought I deleted, which may be the problem...

Here's the template (couldn't figure out how to get it to indent properly here): [http://pastebin.com/HhjX9cUn](http://pastebin.com/HhjX9cUn)

Would simply deleting this template solve my problem?

---

<div class="post-metadata">

### Author: ![TheWinterWizard](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@TheWinterWizard](https://discuss.elastic.co/u/TheWinterWizard)
#### Post date: [November 30, 2015, 6:49pm UTC](https://discuss.elastic.co/t/previously-working-index-failing-to-create/35927/6 "2015-11-30T18:49:53Z")

</div>

Update: I tried deleting the template again and this time it seems to be working. Thanks for your help!

---

<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: [July 5, 2017, 11:34pm UTC](https://discuss.elastic.co/t/previously-working-index-failing-to-create/35927/7 "2017-07-05T23:34:46Z")

</div>


