# Bug found!

**URL:** https://discuss.elastic.co/t/bug-found/201011
**Category:** Elasticsearch
**Created:** [September 25, 2019, 10:44am UTC](https://discuss.elastic.co/t/bug-found/201011 "2019-09-25T10:44:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![stwilliams](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@stwilliams](https://discuss.elastic.co/u/stwilliams)
#### Post date: [September 25, 2019, 10:44am UTC](https://discuss.elastic.co/t/bug-found/201011/1 "2019-09-25T10:44:10Z")

</div>

Found an undocumented feature while importing date data into ES with Search::elasticsearch routine (so not sure where the bug is exactly...)

Error message:  
'reason' =\> 'Cannot parse "2016-02-29 15:56:07 +1100": Value 29 for dayOfMonth must be in the range [1,28]','type' =\> 'illegal\_field\_value\_exception'

Leap year?!?!

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [September 25, 2019, 11:42am UTC](https://discuss.elastic.co/t/bug-found/201011/2 "2019-09-25T11:42:08Z")

</div>

Hm, this clearly looks like a valid date with 2016 being a leap year.

Can you share the full index operation and the Elasticsearch version, so that this can be reproduced locally?

Also, it looks as if you have configured a special mapping for this field, as this is not an ISO8601 date. Can you share that mapping as well?

I tried this under 7.3.2 and the document got indexed...

```auto
PUT foo
{
  "mappings": {
    "properties": {
      "date" : {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss Z"
      }
    }
  }
}

PUT foo/_doc/1
{
  "date" : "2016-02-29 15:56:07 +1100"
}

```

---

<div class="post-metadata">

### Author: ![stwilliams](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@stwilliams](https://discuss.elastic.co/u/stwilliams)
#### Post date: [September 25, 2019, 12:02pm UTC](https://discuss.elastic.co/t/bug-found/201011/3 "2019-09-25T12:02:09Z")

</div>

elasticsearch : 6.5.0-1 (which is probably the issue)

The mapping is...  
{  
"template": "repo\_commit-\*",  
"settings": {  
"number\_of\_shards": 1,  
"number\_of\_replicas": 0  
},  
"mappings": {  
"commit": {  
"properties": {  
"Approver": {  
"type": "text" },  
"Nos\_of\_Approvals": {  
"type": "integer" },  
"Author": {  
"type": "text" },  
"Comment": {  
"type": "text" },  
"Commit": {  
"type": "text" },  
"Date": {  
"type": "date",  
"format": "y-MM-d H:m:s Z" },  
"Merge": {  
"type": "text" },  
"Repo": {  
"type": "keyword" }  
}  
}  
}  
}

Which the java formatting docs suggests is the right string.

The date is generated by 'git log --date=iso'

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [September 25, 2019, 1:08pm UTC](https://discuss.elastic.co/t/bug-found/201011/4 "2019-09-25T13:08:06Z")

</div>

Can you please create a small fully reproducible example, starting with an empty node, creating the template, the index, indexing the document, etc..

I just did this on 6.5.0 and it worked

```auto
PUT test
{
  "mappings": {
    "_doc": {
      "properties": {
        "date": {
          "type": "date",
          "format": "y-MM-d H:m:s Z"
        }
      }
    }
  }
}

PUT foo/_doc/1
{
  "date" : "2016-02-29 15:56:07 +1100"
}

```

thanks

---

<div class="post-metadata">

### Author: ![stwilliams](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@stwilliams](https://discuss.elastic.co/u/stwilliams)
#### Post date: [September 25, 2019, 2:06pm UTC](https://discuss.elastic.co/t/bug-found/201011/5 "2019-09-25T14:06:44Z")

</div>

Gosh darn it.

That worked.

So I did a perl script to test search::elasticsearch - that worked fine

So I went back to the original code and dataset - That parsed without an issue too --- grrrrr

Now I have no idea what caused the error but its gone now.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [September 25, 2019, 2:19pm UTC](https://discuss.elastic.co/t/bug-found/201011/6 "2019-09-25T14:19:37Z")

</div>

weird one. If you ever encounter this again, feel free to ping me here or drop me an email at $firstname.$lastname@elastic.co - thanks a bunch!

---

<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: [October 23, 2019, 2:19pm UTC](https://discuss.elastic.co/t/bug-found/201011/7 "2019-10-23T14:19:37Z")

</div>

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