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


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'}


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.

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.


Do not rely on dynamic mapping in production. Always use index templates

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

but we have 150 fields.

my recommendation is independent from the number of fields. You may want to take a look at dynamic templates to ease things a little bit as well.

Hi Spinscale,

Thanks for your update.

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