# Mapper\_parsing\_exception

**URL:** <https://discuss.elastic.co/t/mapper-parsing-exception/244695>\
**Category:** Elasticsearch\
**Created:** [August 12, 2020, 10:13am UTC](https://discuss.elastic.co/t/mapper-parsing-exception/244695 "2020-08-12T10:13:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![venugrd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venugrd/32/59799_2.png) [@venugrd](https://discuss.elastic.co/u/venugrd)\
**Post date:** [August 12, 2020, 10:13am UTC](https://discuss.elastic.co/t/mapper-parsing-exception/244695/1 "2020-08-12T10:13:47Z")

</div>

Hi

I am facing mapper parsing exception, when i store data in elastic index. please help me to fix this issue

Error:

Log: 2020-08-11 20:50:31,423 ERROR SQL elastic insert error: ('7 document(s) failed to index.', [{'index': {'\_index': 'md-sql-2020-08-11', '\_type': 'sql', '\_id': 'rwxu3nMBfY1jPbuvNUlW', 'status': 400, 'error': {'type': 'mapper\_parsing\_exception', 'reason': "failed to parse field [dbname] of type [date] in document with id 'rwxu3nMBfY1jPbuvNUlW'. Preview of field's value: 'dsfe'", 'caused\_by': {'type': 'illegal\_argument\_exception', 'reason': 'failed to parse date field [dsfe] with format [strict\_date\_optional\_time||epoch\_millis]', 'caused\_by': {'type': 'date\_time\_parse\_exception', 'reason': 'Failed to parse with all enclosed parsers'}}}, 'data': {'dbname': 'dsfe', 'recovery\_model': 'SIMPLE', 'state': 'ONLINE'}

Thanks,

---

<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:** [August 12, 2020, 11:27am UTC](https://discuss.elastic.co/t/mapper-parsing-exception/244695/2 "2020-08-12T11:27:11Z")

</div>

somehow your mapping assumes the `dbname` field to be of a type `date`, which the value `dsfe` in it clearly is not. You have to recreate that index with a correct mapping where the field is very likely a string.

---

<div class="post-metadata">

**Author:** ![venugrd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venugrd/32/59799_2.png) [@venugrd](https://discuss.elastic.co/u/venugrd)\
**Post date:** [August 12, 2020, 11:52am UTC](https://discuss.elastic.co/t/mapper-parsing-exception/244695/3 "2020-08-12T11:52:03Z")

</div>

Hi Spinscale,

Thanks for your update. But this issue occurred some times only. If i delete the index and on next insert its working.

Note : dbname string value only passed.

How to fix this issue permanently.

Thanks

---

<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:** [August 12, 2020, 12:38pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception/244695/4 "2020-08-12T12:38:37Z")

</div>

Do not rely on [dynamic mapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.8/dynamic-mapping.html) in production. Always use [index templates](https://www.elastic.co/guide/en/elasticsearch/reference/7.8/index-templates.html)

---

<div class="post-metadata">

**Author:** ![venugrd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venugrd/32/59799_2.png) [@venugrd](https://discuss.elastic.co/u/venugrd)\
**Post date:** [August 12, 2020, 12:43pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception/244695/5 "2020-08-12T12:43:52Z")

</div>

thanks. you mean need to index mapping to all fields rite

but we have 150 fields.

---

<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:** [August 13, 2020, 7:34am UTC](https://discuss.elastic.co/t/mapper-parsing-exception/244695/6 "2020-08-13T07:34:12Z")

</div>

my recommendation is independent from the number of fields. You may want to take a look at [dynamic templates](https://www.elastic.co/guide/en/elasticsearch/reference/7.8/dynamic-templates.html) to ease things a little bit as well.

---

<div class="post-metadata">

**Author:** ![venugrd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venugrd/32/59799_2.png) [@venugrd](https://discuss.elastic.co/u/venugrd)\
**Post date:** [August 13, 2020, 7:38am UTC](https://discuss.elastic.co/t/mapper-parsing-exception/244695/7 "2020-08-13T07:38:02Z")

</div>

Hi Spinscale,

Thanks for your update.

---

<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:** [September 10, 2020, 7:38am UTC](https://discuss.elastic.co/t/mapper-parsing-exception/244695/8 "2020-09-10T07:38:19Z")

</div>

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