not_x_content_exception: Compressor detection error / body is not valid content
ElasticsearchWhat does it mean?
Elasticsearch could not recognize the request body as valid structured content (XContent such as JSON). The data sent is not in the expected format or is corrupted.
Why does it happen?
The request body is invalid JSON; a wrong or missing Content-Type header (application/json not sent); the body was accidentally sent compressed/binary; or plain JSON was sent to endpoints such as _bulk that expect newline-delimited JSON (NDJSON). Escaping/encoding errors also trigger it.
How to fix it
Verify that the request body is valid JSON and send the Content-Type: application/json header. For the _bulk endpoint use NDJSON, where each line is a separate JSON object and the final line ends with a newline (Content-Type: application/x-ndjson). Make sure your client library serializes the body correctly. If you use compression, send the appropriate Content-Encoding header.
More from this engine
- index_template_missing_exceptionIndex template is missing
- settings_exceptionInvalid settings
- shard_not_found_exceptionShard not found
- document_source_missing_exceptionDocument source is missing
- node_not_connected_exceptionNode is not connected
- receive_timeout_transport_exceptionRequest timed out waiting for a response from another node
- routing_missing_exceptionRouting value is required for this document