Getting an error when setting include_type_name to True

Hi,

I use a Python script to create an index. For certain reasons, I need it to work on both Elasticsearch 6 and 7, so I want to set include_type_name. I have this line of code:

response = es.indices.create(index=index, body=body, include_type_name=True)

However, I keep getting this error:
elasticsearch.exceptions.TransportError: TransportError(500, 'class_cast_exception', "class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')")

When I set it to false, it creates the index normally. Any idea why this might be happening?

Hi @kristin

is this happening only when using the Python APM agent? I'm asking because you opened this topic in the APM category of our forum. If the problem is not related to APM, I can move it to the Elasticsearch category, which is better suited to help you with Elasticsearch client questions.

Cheers
Beni

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