Failed to load resource: the server responded with a status of 406 (Not Acceptable)

We have added plugin to kibana but facing as error (we can see on console tab of browser) while making API call to elasticsearch=>

Failed to load resource: the server responded with a status of 406 (Not Acceptable)

I'm not sure but may be your elasticsearch cluster is secured and is using https? Could you reproduce the exact call done by your script using curl? And share the call and the response?

Below is the curl response :

Sunils-MacBook-Pro:kibana sunil$ curl -H "Content-Type: application/json" -XPOST "http://localhost:9200/sunil_test/_doc/optionalUniqueId" -d "{ \"customer_id\" : \"133\"}"

{"_index":"sunil_test","_type":"_doc","_id":"optionalUniqueId","_version":2,"result":"updated","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":3,"_prim

Are you sure that your script passes -H "Content-Type: application/json" as well?
I think you could debug maybe that call and see what is the exact http request sent to Elasticsearch?

1 Like

A 406 from Elasticsearch is almost always due to an incorrect content-type. I expect, if you expand the body of the response, it will tell you that.

1 Like