-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid JSON in Console causes confusing response #10504
Comments
What version of Kibana are you using? We recently changed the content-type handling in console, and it should never be sending as text/plain. |
Sorry, that's not correct. I see there is still a potential fallback to text/plain even in the latest. |
@jbudz Can you think of any reason why we'd want to send anything as |
I don't feel strongly about it, but the original reason was to avoid errors from any in between servers parsing the body based on content type. /cc @spalger |
Could we not always use |
I wish there was a future proof way of determining the encoding on the fly so that we don't need to worry about potential future mismatches in requirements between Elasticsearch and Kibana console, but clearly it's fragile one way or another, so leaning on the msearch/bulk endpoints may be the best option. |
We could also retry requests (with a different content-type) that are rejected based on content type |
Steps to reproduce:
From Console run the following:
Note that there is a comma missing in the search request
Response:
Whilst doing the request directly to ES using cURL gives:
It seems that if the JSON is invalid we send it as plain text. It would be better if we just send the request as JSON and show the above error (the cURL one), since the user may not have seen that they have an error on the request side.
The text was updated successfully, but these errors were encountered: