Content-Type header [] is not supported

See original GitHub issue

In order to help us troubleshoot issues with this project, you must provide the following details:

I seem to be getting the error Content-Type header [] is not supported with Elastic 6 beta.

is there a command line argument I can add to include the content type? This isn’t a problem specific to elasticdump, it is a change in Elasticsearch 6.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:30

github_iconTop GitHub Comments

27reactions
morgangocommented, Sep 28, 2017

I answered my own question with a simple read of the documentation. I added:

--headers='{"Content-Type": "application/json"}' to the end of my command and it worked splendidly.

3reactions
aliostadcommented, Dec 13, 2017

I am getting @maniankara error (unrecognised token):

I am sending both --type: data and --header. I get an error if I do not send the headers (same Content-Type header [] is not supported).

Wed, 13 Dec 2017 11:49:14 GMT | starting dump
Wed, 13 Dec 2017 11:49:16 GMT | got 100 objects from source elasticsearch (offset: 0)
Wed, 13 Dec 2017 11:49:16 GMT | sent 100 objects to destination file, wrote 100
Wed, 13 Dec 2017 11:49:16 GMT | Error Emitted => {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Failed to parse request body"}],"type":"illegal_argument_exception","reason":"Failed to parse request body","caused_by":{"type":"json_parse_exception","reason":"Unrecognized token 'DnF1ZXJ5VGhlbkZldGNowAIAAAAAAN4jWRZQaERwb3lnaVE1NkVDVE9qSGkwVnRRAAAAAAETdU8WSU8yNjA0NDZUV0N0blgtNTlaVG9RdwAAAAAA7vGUFnBQQjkxXzdsVEpLRlVNbUNSdzdXOXcAAAAAAO7xlRZwUEI5MV83bFRKS0ZVTW1DUnc3Vzl3AAAAAADu8ZYWcFBCOTFfN2xUSktGVU1tQ1J3N1c5dwAAAAABE3VQFklPMjYwNDQ2VFdD...': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@348bd801; line: 1, column: 257]"}},"status":400}
Wed, 13 Dec 2017 11:49:16 GMT | Total Writes: 100
Wed, 13 Dec 2017 11:49:16 GMT | dump ended with error (get phase) => Error: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Failed to parse request body"}],"type":"illegal_argument_exception","reason":"Failed to parse request body","caused_by":{"type":"json_parse_exception","reason":"Unrecognized token 'DnF1ZXJ5VGhlbkZldGNowAIAAAAAAN4jWRZQaERwb3lnaVE1NkVDVE9qSGkwVnRRAAAAAAETdU8WSU8yNjA0NDZUV0N0blgtNTlaVG9RdwAAAAAA7vGUFnBQQjkxXzdsVEpLRlVNbUNSdzdXOXcAAAAAAO7xlRZwUEI5MV83bFRKS0ZVTW1DUnc3Vzl3AAAAAADu8ZYWcFBCOTFfN2xUSktGVU1tQ1J3N1c5dwAAAAABE3VQFklPMjYwNDQ2VFdD...': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@348bd801; line: 1, column: 257]"}},"status":400}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Content-type header not supported - elasticsearch
I am trying following curl to post the json data. curl -XPOST "http://localhost:9200/shakespeare/_bulk?pretty" --data-binary @D:\data\ ...
Read more >
Content-Type header [application/vnd.elasticsearch+json; ...
ApiError: ApiError(406, 'Content-Type header [application/vnd.elasticsearch+json; compatible-with=8] is not supported', 'Content-Type header ...
Read more >
HTTP request with Content-type not supported
I get an error message in response : "Content-type '' not supported" However I have the following Headers: "Accept-Version": "V2",
Read more >
Content-Type - HTTP - MDN Web Docs - Mozilla
In responses, a Content-Type header provides the client with the actual content type of the returned content. This header's value may be ignored...
Read more >
406, u'Content-Type header [] is not supported'
How to fix error ElasticHttpError: (406, u'Content-Type header [] is not supported') ... This should resolve the error. However there is work around...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found