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

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

Closed
sebelga opened this issue Sep 19, 2019 · 4 comments
Closed

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

sebelga opened this issue Sep 19, 2019 · 4 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@sebelga
Copy link
Contributor

sebelga commented Sep 19, 2019

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.

@sebelga sebelga added bug Fixes for quality problems that affect the customer experience Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Sep 19, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui

@albertzaharovits
Copy link
Contributor

@sebelga I was amiss with regard to the privileges required for some of the actions.
To be clear:
GET _cat/indices - requires view_index_metadata and monitor index privileges as well as the monitor cluster privilege.
GET _cat/aliases - requires the view_index_metadata index privilege.

@sebelga
Copy link
Contributor Author

sebelga commented Oct 3, 2019

@albertzaharovits ok thanks for clarifying!

@yuliacech
Copy link
Contributor

Closing this issue because Index Management doesn't make any calls to _cat APIs anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

4 participants