elastic es helpers bulk-ingest with NDJSON input fails with 406 because the request reaches Elasticsearch with Content-Type: application/x-ndjson, application/x-ndjson. The helper sets the header explicitly, and the transport layer also sets it for NDJSON bodies. Effectively the NDJSON path is unusable.
Reproducer (CLI 0.1.1):
$ printf '{"name":"a"}\n{"name":"b"}\n' > /tmp/x.ndjson && elastic es helpers bulk-ingest --index test --data-file /tmp/x.ndjson --source-format ndjson --json
{"error":{"code":"transport_error","status_code":406,"body":{"error":"Content-Type header [application/x-ndjson, application/x-ndjson] is not supported","status":406}}}
Suggested fix: drop the explicit Content-Type: application/x-ndjson header in the helper and let the transport set it once.
elastic es helpers bulk-ingestwith NDJSON input fails with406because the request reaches Elasticsearch withContent-Type: application/x-ndjson, application/x-ndjson. The helper sets the header explicitly, and the transport layer also sets it for NDJSON bodies. Effectively the NDJSON path is unusable.Reproducer (CLI
0.1.1):Suggested fix: drop the explicit
Content-Type: application/x-ndjsonheader in the helper and let the transport set it once.