Inconsistent behaviour: GET /_all/_alias with no indices emits a http 404 when x-pack is enabled #56027
Labels
:Security/Authorization
Roles, Privileges, DLS/FLS, RBAC/ABAC
Team:Security
Meta label for security team
Elasticsearch version : 6.8.8
License: Basic
Plugins installed: []
Description:
Calling GET on the Alias API for any indices, when there are no indices, produces an expection with http 404 status code when x-pack (security) is enabled. It returns HTTP 200 and an empty JSON object, when x-pack (Security) is disabled.
These discussions seem related:
Pattern exclusion not working properly on aliases when security is enabled #33805
Revise get aliases response #30536
I understood from the that there were other inconsistencies in this API with regard to the status codes, and that they were addressed. This seems slightly different. It should behave the same with or without x-pack enabled.
Steps to reproduce:
At this point x-pack (security) is enabled. There are no indices.
$ curl -X GET -u user:pass http://host:9200/_all
{}
$ curl -X GET -u user:pass http://host:9200/_all/_alias
{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","index_uuid":"na","index":"_all"}],"type":"index_not_found_exception","reason":"no such index","index_uuid":"na","index":"_all"},"status":404}
$ curl -X GET -u user:pass http://host:9200/_alias
{}
After disabling x-pack:
$ curl http://host:9200/_all/_alias
{}
$ curl http://host:9200/_alias
{}
The text was updated successfully, but these errors were encountered: