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

Field Caps failing if using an alias pointing to a closed index #77612

Closed
timroes opened this issue Sep 13, 2021 · 2 comments
Closed

Field Caps failing if using an alias pointing to a closed index #77612

timroes opened this issue Sep 13, 2021 · 2 comments
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@timroes
Copy link
Contributor

timroes commented Sep 13, 2021

Currently when using an index pattern to get field caps over a set of indices where some might be closes works completely fine. If you use an alias for those indexes instead the _field_caps call suddenly fails.

Requests to reproduce this:

PUT /closed-test-1
{
  "settings": {
    "number_of_shards": 1
  },
  "mappings": {
    "properties": {
      "@timestamp": {
        "type": "date"
      }
    }
  },
  "aliases": {
    "alert": {}
  }
}

PUT /closed-test-2
{
  "settings": {
    "number_of_shards": 1
  },
  "mappings": {
    "properties": {
      "@timestamp": {
        "type": "date"
      }
    }
  },
  "aliases": {
    "alert": {}
  }
}

POST closed-test-1/_close

GET closed-test-*/_field_caps?fields=*
GET alert/_field_caps?fields=*

Actual behavior

The field_caps call against closed-test-* works perfecty fine and returns a result for only closed-test-2. The _field_caps call against alert will fail with:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "cluster_block_exception",
        "reason" : "index [closed-test-1] blocked by: [FORBIDDEN/4/index closed];"
      }
    ],
    "type" : "cluster_block_exception",
    "reason" : "index [closed-test-1] blocked by: [FORBIDDEN/4/index closed];"
  },
  "status" : 403
}

Expected behavior

Both field caps calls should behave the same and return the same result in this example. The 2nd field_caps call should not fail.

Related Kibana issue: elastic/kibana#111699

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@jimczi
Copy link
Contributor

jimczi commented Sep 13, 2021

This is a known issue that affects lots of APIs, closing as duplicate of #32238.

@jimczi jimczi closed this as completed Sep 13, 2021
@javanna javanna added Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch and removed Team:Search Meta label for search team labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

4 participants