Skip to content
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 behaviour: GET /_all/_alias with no indices emits a http 404 when x-pack is enabled #56027

Closed
jrunu opened this issue Apr 30, 2020 · 2 comments
Labels
:Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team

Comments

@jrunu
Copy link

jrunu commented Apr 30, 2020

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
{}

@jrunu jrunu changed the title Inconsistent behaviour: GET /_all/_alias on empty elastic emits a http 404 when x-pack is enabled Inconsistent behaviour: GET /_all/_alias with no indices emits a http 404 when x-pack is enabled Apr 30, 2020
@jakelandis jakelandis added the :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC label Apr 30, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security (:Security/Authorization)

@elasticmachine elasticmachine added the Team:Security Meta label for security team label Apr 30, 2020
@albertzaharovits
Copy link
Contributor

@jrunu Thanks for reporting, and apologies for letting this slip by!

The issue you're describing has been fixed in 7.0 in #34444 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team
Projects
None yet
Development

No branches or pull requests

4 participants