-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Inconsistent treatment of invalid characters in index and bulk requests #61763
Comments
Pinging @elastic/es-core-infra (:Core/Infra/REST API) |
Pinging @elastic/es-distributed (:Distributed/CRUD) |
I think this falls under the distributed area as it's really about the behavior of bulk indexing requests (which I think CRUD includes), not about general infrastructure of all requests. |
This looks like Kibana is not properly URL escaping the index name: If I URL escape that index name using https://www.urlencoder.org, I get
Kibana DEV console also does not look to properly escape either.
returns
whereas the properly escaped
returns
|
Thanks, @ywelsch! You're right. It looks like this encoding step might be missing in the Elasticsearch JS client. Once I can confirm where the problem resides (in the client or in Kibana), I'll close this. @elastic/es-clients I'm making a request to
The response is this error:
Does the client expect the consumer to url-encode the path? Or should the client be responsible for that? |
Hello! The js client is encoding only URL parameters and not the entire URL, see here for example. I fear the issue might be caused by the difference between
Side note, |
Thanks for your help @delvedor! We'll fix this on the Kibana side. |
A user has gotten into a situation where the Index Management UI fails to load indices named like
%{[@metadata][beat]}-%{[@metadata][version]}-2020.08.23
(elastic/kibana#75869). This occurs because we're fetching indices using the get index API (https://github.com/elastic/kibana/pull/66422/files#diff-784d69eb6ea217af4edd2559d5ca2445R44), which complains about these indices' names with an error like this one:This looks similar to other problems users have reported regarding Logstash creating indices with these names (https://discuss.elastic.co/t/logstash-index-name-as-metadata-beat-metadata-version/184225). I suspect that Logstash is using the bulk API, which will allow creation of an index with this name (disallowed by the index API):
It seems reasonable for the index API to reject invalid characters like %, [, and {, but inconsistent for the bulk API to allow them. It also seems trappy because then users can get into the situation as in the first link I shared, in which parts of the stack break for no clear reason, due to unexpected interactions between other parts of the stack.
Possibly related: #48308, #9379
The text was updated successfully, but these errors were encountered: