# Mapping parser exception

**URL:** <https://discuss.elastic.co/t/mapping-parser-exception/334322>\
**Category:** Elasticsearch\
**Created:** [May 25, 2023, 1:07pm UTC](https://discuss.elastic.co/t/mapping-parser-exception/334322 "2023-05-25T13:07:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anand\_Konagala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anand_konagala/32/120215_2.png) [@Anand\_Konagala](https://discuss.elastic.co/u/Anand_Konagala)\
**Post date:** [May 25, 2023, 1:07pm UTC](https://discuss.elastic.co/t/mapping-parser-exception/334322/1 "2023-05-25T13:07:29Z")

</div>

I am using Elasticsearch 8.7.0.......  
While inserting any document I am getting this kind of error. In previously versions which includes the field path where got and error now It Shows only RequestError(400, 'mapper\_parsing\_exception', 'failed to parse')

/usr/bin/python3.8 /home/anand/PycharmProjects/SampleProject1/Elasticsearch\_practice.py  
Traceback (most recent call last):  
File "/home/anand/PycharmProjects/SampleProject1/Elasticsearch\_practice.py", line 1245, in   
response = dell\_esconnection.index(index="mr-jobs2", doc\_type="\_doc", id=str("54bf556160e65dc20379e7d8"), body=doc\_body)  
File "/home/anand/.local/lib/python3.8/site-packages/elasticsearch/client/utils.py", line 168, in \_wrapped  
return func(\*args, params=params, headers=headers, \*\*kwargs)  
File "/home/anand/.local/lib/python3.8/site-packages/elasticsearch/client/ **init**.py", line 406, in index  
return self.transport.perform\_request(  
File "/home/anand/.local/lib/python3.8/site-packages/elasticsearch/transport.py", line 458, in perform\_request  
raise e  
File "/home/anand/.local/lib/python3.8/site-packages/elasticsearch/transport.py", line 419, in perform\_request  
status, headers\_response, data = connection.perform\_request(  
File "/home/anand/.local/lib/python3.8/site-packages/elasticsearch/connection/http\_urllib3.py", line 277, in perform\_request  
self.\_raise\_error(response.status, raw\_data)  
File "/home/anand/.local/lib/python3.8/site-packages/elasticsearch/connection/base.py", line 330, in \_raise\_error  
raise HTTP\_EXCEPTIONS.get(status\_code, TransportError)(  
elasticsearch.exceptions.RequestError: RequestError(400, 'mapper\_parsing\_exception', 'failed to parse')

Process finished with exit code 1

I updated my setting to.....  
PUT my-index-000001  
{  
"settings": {  
"index.mapping.ignore\_malformed": true  
}  
for ignore the parser\_exception Still it showing this kind of error How can I solve this && Why I got this error???

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [May 25, 2023, 1:37pm UTC](https://discuss.elastic.co/t/mapping-parser-exception/334322/2 "2023-05-25T13:37:09Z")

</div>

> [@Anand\_Konagala](#):
>
> Why I got this error???

Mapping parser exception is a common error, it means that you are trying to index a field that has a different mapping on your index.

Please, share the mapping of your index, you can get it running `GET indexName/_mapping` on Kibana Dev Tools.

> [@Anand\_Konagala](#):
>
> for ignore the parser\_exception Still it showing this kind of error

`ignore_malformed` does not work for every mapping type as explained in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-malformed.html#json-object-limits), it does not work for the most common issue of this error which is when you have mapping conflict with fields that are json objects.

Please share your mapping and also the document you are trying to index.

---

<div class="post-metadata">

**Author:** ![Anand\_Konagala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anand_konagala/32/120215_2.png) [@Anand\_Konagala](https://discuss.elastic.co/u/Anand_Konagala)\
**Post date:** [May 25, 2023, 1:53pm UTC](https://discuss.elastic.co/t/mapping-parser-exception/334322/3 "2023-05-25T13:53:21Z")

</div>

Which is very Large it exceeds the limit of characters. So,Can you tell me that how can I find that Where I got an error  
This is my mapping

```auto
{
  "mr-index" : {
    "mappings" : {
      "properties" : {
        "approverID" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "articleID" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "campaignModules" : {
          "properties" : {
            "enabled" : {
              "type" : "boolean"
            },
            "engageAI" : {
              "properties" : {
                "enabled" : {
                  "type" : "boolean"
                }
              }
            },
            "matchAI" : {
              "properties" : {
                "enabled" : {
                  "type" : "boolean"
                }
              }
            },
            "qualifyAI" : {
              "properties" : {
                "enabled" : {
                  "type" : "boolean"
                }
              }
            },
            "sourceAI" : {
              "properties" : {
                "enabled" : {
                  "type" : "boolean"
                },
                "portalSourcing" : {
                  "properties" : {
                    "enabled" : {
                      "type" : "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "clientID" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "clientName" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "closedAt" : {
          "type" : "date",
          "ignore_malformed" : false,
          "format" : "[yyy-MM-dd HH:mm:ss]"
        },
        "collection" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "collections" : {
          "properties" : {
            "articles" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "campaigns" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "folderSource" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "interviews" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "resumes" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        },
        "companyID" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "createdAt" : {
          "type" : "date",
          "ignore_malformed" : false,
          "format" : "[yyy-MM-dd HH:mm:ss]"
        },
        "customData" : {
          "properties" : {
            "552d016291bad07ccbb455fe" : {
              "properties" : {
                "62eca510504570b3e2596148" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "62eca5d5504570b3e259614c" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "63117e53040322666b9d2364" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "date"
                    }
                  }
                },
                "63117e678ba4b39ba56ed111" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "date"
                    }
                  }
                },
                "631192a7f8181c6716c42c3a" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "date"
                    }
                  }
                },
                "631587ee36e9ea952fdcf21f" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "63189636a64e953015c94d34" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "date"
                    }
                  }
                },
                "6318985c3d9d733abd24b20a" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "date"
                    }
                  }
                },
                "631967148c409ba4e5b28ca1" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "63196d65217d7d01fe87de03" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "date"
                    }
                  }
                },
                "63197ec85ab6754991cee649" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "date"
                    }
                  }
                },
                "6319f44d106fd97a086c12ef" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "date"
                    }
                  }
                },
                "631eb04bf73f4c2c72631c62" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "date"
                    }
                  }
                },
                "639034722461ef2ecda557e6" : {
                  "properties" : {
                    "filepath" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "63a1a171a2b79131d6a7bbd0" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "642e9becbfa2fa594dbd77b6" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "boolean"
                    }
                  }
                }
              }
            },
            "5fb276fa123f55bd44e1569d" : {
              "properties" : {
                "63ecc55a65f0cebca6661e81" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "63ecc717c65eeb12c684bd66" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "63ecc77ec65eeb12c684bd67" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                }
              }
            },
            "6112806bc9147f673d28c6eb" : {
              "properties" : {
                "621f18661e6fe269da81d312" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "621f193c1e6fe269da81d319" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "621f1a121e6fe269da81d31b" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "621f1a511e6fe269da81d31d" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "621f5b6ca348b26edabc6540" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "label" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    },
                    "value" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",
                          "ignore_above" : 256
                        }
                      }
                    }
                  }
                },
                "621f5b82a348b26edabc6543" : {
                  "properties" : {
                    "format" : {
                      "type" : "text",
                      "fields" : {
                        "keyword" : {
                          "type" : "keyword",

```

And also tell me that Why it is not showing that Where I got a error

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [May 25, 2023, 2:33pm UTC](https://discuss.elastic.co/t/mapping-parser-exception/334322/4 "2023-05-25T14:33:35Z")

</div>

> [@Anand\_Konagala](#):
>
> So,Can you tell me that how can I find that Where I got an error

According to this [github comment](https://github.com/elastic/elasticsearch-py/issues/551#issuecomment-442512688) you need to capture the _TransportError_ and print it to see the full error.

Something like this:

```auto
try:
    # code you are using to try to index the data
except TransportError as e:
    print(e.info)

```

You may also compare the fields in your document with the same fields in your mapping to see which one could give you a mapping error, for example, being a object in your document, but not in the mapping.

---

<div class="post-metadata">

**Author:** ![Anand\_Konagala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anand_konagala/32/120215_2.png) [@Anand\_Konagala](https://discuss.elastic.co/u/Anand_Konagala)\
**Post date:** [May 26, 2023, 3:52am UTC](https://discuss.elastic.co/t/mapping-parser-exception/334322/5 "2023-05-26T03:52:55Z")

</div>

![Screenshot from 2023-05-26 09-21-00](https://us1.discourse-cdn.com/elastic/original/3X/2/7/279b1f59ab81f01f7c316df8adfbdf850ac2a80a.png)  
Again It return Same Error.. Their is no proper explaination  
Show me an another way...

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [May 26, 2023, 12:06pm UTC](https://discuss.elastic.co/t/mapping-parser-exception/334322/6 "2023-05-26T12:06:07Z")

</div>

> [@Anand\_Konagala](#):
>
> Again It return Same Error.. Their is no proper explaination  
> Show me an another way...

You used `print(e)`, the comment on github tells you to use `print(e.info)`, please try with this.

---

<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:** [June 23, 2023, 12:06pm UTC](https://discuss.elastic.co/t/mapping-parser-exception/334322/7 "2023-06-23T12:06:54Z")

</div>

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