Skip to content

[Index management] Make UI resilient to failing _cat/aliases call #46126

@sebelga

Description

@sebelga

In order to build the table of indices in Index Management, we make 2 requests to Elasticsearch

GET _cat/indices
GET _cat/aliases

But there is a bug in ES (elastic/elasticsearch#46856) that requires the manage privilege on all indices ("*") in order to execute the _cat/aliases. Otherwise it throws the following error

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

This means that, if a user does not have that privilege, the table does not render any indices and the following toast message is displayed

Screen Shot 2019-09-19 at 11 48 11

As displaying the aliases information is an enrichment of the index data, we should make our UI resilient to the fact that aliases haven't been fetched.

// x-pack/plugins/index_management/server/lib/fetch_indices.js

export const fetchIndices = async (callWithRequest, isEsError, indexNames) => {
  try {
    // We should **not** throw if this fetchAliases call fails
    const aliases = await fetchAliases(callWithRequest);
    const hits = await fetchIndicesCall(callWithRequest, indexNames);

And then update the UI accordingly to display or not the aliases information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:Index ManagementIndex and index templates UITeam:Kibana ManagementDev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t//bugFixes for quality problems that affect the customer experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions