Once a base is created when i send a put request with :
r = requests.put("http://localhost:9200//_doc/", data=, headers=headers)
I have sometimes exception in elasticsearch :
[2020-02-12T19:09:42,487][INFO ][o.e.c.m.MetaDataMappingService] [DESKTOP-D8M21T8] [logbooks_index_concepts/MNj_ZkWZQ2eTGJgxMhNEtw] update_mapping [_doc]
[2020-02-12T19:09:51,490][WARN ][o.e.m.j.JvmGcMonitorService] [DESKTOP-D8M21T8] [gc][1662] overhead, spent [824ms] collecting in the last [1.2s]
[2020-02-12T19:09:55,508][WARN ][o.e.m.j.JvmGcMonitorService] [DESKTOP-D8M21T8] [gc][1666] overhead, spent [597ms] collecting in the last [1s]
[2020-02-12T19:10:01,432][DEBUG][o.e.a.b.TransportShardBulkAction] [DESKTOP-D8M21T8] [logbooks_index_concepts][0] failed to execute bulk item (index) index {[logbooks_index_concepts][_doc][219], source[n/a, actual length: [2mb], max length: 2kb]}
org.elasticsearch.index.mapper.MapperParsingException: failed to parse field [@section.k2] of type [text] in document with id '219'. Preview of field's value: ''
at org.elasticsearch.index.mapper.FieldMapper.parse(FieldMapper.java:299) ~[elasticsearch-7.5.1.jar:7.5.1]
at org.elasticsearch.index.mapper.DocumentParser.parseObjectOrField(DocumentParser.java:488) ~[elasticsearch-7.5.1.jar:7.5.1]
at org.elasticsearch.index.mapper.DocumentParser.parseValue(DocumentParser.java:614) ~[elasticsearch-7.5.1.jar:7.5.1]
How to get the exception from python script :
[logbooks_index_concepts][0] failed to execute bulk item (index) index {[logbooks_index_concepts][_doc][219], source[n/a, actual length: [2mb], max length: 2kb]}
org.elasticsearch.index.mapper.MapperParsingException: failed to parse field [@section.k2] of type [text] in document with id '219'. Preview of field's value: ''
at org.elasticsearch.index.mapper.FieldMapper.parse(FieldMapper.java:299)
I don't succed to get it from my python script.