Skip to content

6.4.0-SNAPSHOT fails get all aliases with security enabled and no indices exist #31516

@dakrone

Description

@dakrone

Due to: #31308

There is an issue with security when retrieving all aliases and no indices exist.

Reproduction:

  • Use a 6.4.0-SNAPSHOT build with xpack.security.enabled: true in elasticsearch.yml
  • Configure a file realm user with superuser role
  • Start elasticsearch and start an x-pack trial
  • Then attempt to retrieve all aliases:
~/elasticsearch-6.4.0-SNAPSHOT λ curl -XGET -u"foo:bar" "localhost:9200/_aliases"
{}
~/elasticsearch-6.4.0-SNAPSHOT λ curl -XPOST "localhost:9200/_xpack/license/start_trial?acknowledge=true"
{"acknowledged":true,"trial_was_started":true,"type":"trial"}
~/elasticsearch-6.4.0-SNAPSHOT λ curl -XGET -u"foo:bar" "localhost:9200/_aliases"
{"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}

With 38b1a5f reverted, the correct behavior can be seen:

~/elasticsearch-6.4.0-SNAPSHOT λ curl -XGET -u"foo:bar" "localhost:9200/_aliases"
{}
~/elasticsearch-6.4.0-SNAPSHOT λ curl -XPOST "localhost:9200/_xpack/license/start_trial?acknowledge=true"
{"acknowledged":true,"trial_was_started":true,"type":"trial"}
~/elasticsearch-6.4.0-SNAPSHOT λ curl -XGET -u"foo:bar" "localhost:9200/_aliases"
{}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions