# Mapper Parsing Exception after Upgrade to 5.1.1

**URL:** <https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853>\
**Category:** Elasticsearch\
**Created:** [December 22, 2016, 11:08pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853 "2016-12-22T23:08:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [December 22, 2016, 11:08pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853/1 "2016-12-22T23:08:32Z")

</div>

I recently upgraded from ES 2.4.1 to ES 5.1.1 (along with Kibana, & logstash now at 5.1.1) and am getting mapper parsing exceptions;

```
{"index"=>{"_index"=>"filebeat-2016.12.22", "_type"=>"stunnel", "_id"=>"AVkohgLnKCAslFsq6wTS", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Can't parse [index] value [not_analyzed] for field [version], expected [true] or [false]"}}}}, :level=>:warn}

```

This is occurring on basically all of my 'types' for this index.

Using Sense, I can query the mapping for this index and type, but unsure of what I need to change in this mapping.

```
      "stunnel": {
    "_all": {
      "enabled": true,
      "norms": false
    },
    "dynamic_templates": [
      {
        "template1": {
          "match": "*",
          "mapping": {
            "doc_values": true,
            "ignore_above": 1024,
            "index": "not_analyzed",
            "type": "{dynamic_type}"
          }
        }
      }
    ],
    "properties": {
      "@timestamp": {
        "type": "date",
        "format": "strict_date_optional_time||epoch_millis"
      },
      "@version": {
        "type": "string",
        "index": "not_analyzed",
        "ignore_above": 1024,
        "fielddata": false

```

do I want to update version: index as such;

```
      "@version": {
        "type": "string",
        "index": "false",
        "ignore_above": 1024,
        "fielddata": false

```

This is happening for every 'type' I have in this index.

---

<div class="post-metadata">

**Author:** ![Hector\_Rodriguez](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Hector\_Rodriguez](https://discuss.elastic.co/u/Hector_Rodriguez)\
**Post date:** [January 17, 2017, 10:41am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853/2 "2017-01-17T10:41:59Z")

</div>

I had exactly the same problem, can't fix by now.

---

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [January 17, 2017, 4:26pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853/3 "2017-01-17T16:26:26Z")

</div>

Yeah I can't figure it out, probably going to just downgrade to 2.4 as I'm not getting much assistance in this forum anymore. If I get it figured out I'll post here!

---

<div class="post-metadata">

**Author:** ![Hector\_Rodriguez](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Hector\_Rodriguez](https://discuss.elastic.co/u/Hector_Rodriguez)\
**Post date:** [January 18, 2017, 7:33am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853/4 "2017-01-18T07:33:37Z")

</div>

I think it's cause "string" type present in mappings is not correctly mapped in the new way.

String type should be changed to:  
{ "type": "text",  
"fields": {  
"raw": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}

In my case when i tried to charge the snapshot of my old index in elastic5, the restore operation works fine, cause old mappings should be well interpreted, but in the execution of my app, when the app was going to use the new index it crashed with the same error as you.

I do a workaround, restoring the old index in the new elastic5 instance but in other index, and next reindex my data in the rigth index precreated with the correct mapping.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 18, 2017, 7:55am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853/5 "2017-01-18T07:55:34Z")

</div>

The problem is:

```auto
Can't parse [index] value [not_analyzed] for field [version], expected [true] or [false]

```

So you need to remove `"index": "not_analyzed"`.  
Actually may be remove `template1`?

---

<div class="post-metadata">

**Author:** ![Sagar\_Shukla](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@Sagar\_Shukla](https://discuss.elastic.co/u/Sagar_Shukla)\
**Post date:** [February 6, 2017, 10:23am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853/6 "2017-02-06T10:23:06Z")

</div>

Did someone find a solution to this issue?

Recently, I upgraded from ElasticSearch 2.4.4 to 5.2.0 and though my indexes got upgraded but new inserts are failing with error message seen by others.

Any solution found would be greatly appreciated.

Regards,  
Sagar

---

<div class="post-metadata">

**Author:** ![Hector\_Rodriguez](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Hector\_Rodriguez](https://discuss.elastic.co/u/Hector_Rodriguez)\
**Post date:** [February 6, 2017, 10:36am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853/7 "2017-02-06T10:36:58Z")

</div>

> [@Hector\_Rodriguez](#):
>
> I do a workaround, restoring the old index in the new elastic5 instance but in other index, and next reindex my data in the rigth index precreated with the correct mapping.

I use this workaround:  
Restore the old index in the new elastic5 instance in a index without mapping, and next reindex my data in an index with the mapping I want to use.

---

<div class="post-metadata">

**Author:** ![Sagar\_Shukla](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@Sagar\_Shukla](https://discuss.elastic.co/u/Sagar_Shukla)\
**Post date:** [February 6, 2017, 6:08pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853/8 "2017-02-06T18:08:35Z")

</div>

Can you please share more specific commands used for your environment, so that I can get some better understanding of what you have been doing?

---

<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 6, 2017, 6:08pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-after-upgrade-to-5-1-1/69853/9 "2017-03-06T18:08:54Z")

</div>

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