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

Searching multiple aliases using wildcard and ignore_unavailable=true throws index closed exception #13278

Closed
bradvido opened this issue Sep 2, 2015 · 4 comments · Fixed by #15882
Assignees
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates

Comments

@bradvido
Copy link
Contributor

bradvido commented Sep 2, 2015

Each of my logstash-YYYY.MM.DD indices has a filtered alias added to it named error_messages-YYYY.MM.DD. Any that are older than 30 days are closed.

I'm seeing strange behavior when trying to do a match_all query on error_messages-*.

This is using the Java transport client. ES version 1.6.0.

SearchResponse sr = client.prepareSearch("error_messages-*")
  .setQuery(QueryBuilders.matchAllQuery())
  .execute().actionGet();
throws:
org.elasticsearch.indices.IndexClosedException: [logstash-2015.07.30] closed

So I set IndicesOptions.lenientExpandOpen() to ignore unavailable indices and got a different (but similiar) error.

SearchResponse sr = client.prepareSearch("error_messages-*")
  .setQuery(QueryBuilders.matchAllQuery())
  .setIndicesOptions(IndicesOptions.lenientExpandOpen())
  .execute().actionGet();
throws:
org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [FORBIDDEN/4/index closed]

Interestingly, this query works via HTTP API in Marvel:

POST error_messages-*/_search?ignore_unavailable=true
{
  "query": {
    "match_all": {}
  }
}

Also interesting is if I use the concrete index pattern logstash-*, the queries work in Java.

@clintongormley
Copy link
Contributor

@javanna any ideas here?

@javanna
Copy link
Member

javanna commented Oct 15, 2015

sorry it took me a while to get to this, I confirm it's a bug, we don't look at the state of the aliases although we should after #9057. Need to dig deeper to see if this is a regression or just something that we never really covered.

@javanna javanna added >bug and removed discuss labels Oct 15, 2015
@javanna javanna self-assigned this Oct 15, 2015
@bradvido
Copy link
Contributor Author

Nice, thanks for the confirmation

@clintongormley clintongormley added :Aliases :Data Management/Indices APIs APIs to create and manage indices and templates labels Oct 15, 2015
@oferbar
Copy link

oferbar commented Jan 9, 2016

I'm seeing the same issue. When can we expect a fix and in which version of es? (currently on 1.6)
Thx

s1monw added a commit to s1monw/elasticsearch that referenced this issue Jan 11, 2016
We fail today with ClusterBlockExceptions if an alias expands to a closed index
during search since we miss to check the index option down the road after we expanded
aliases.

Closes elastic#13278
s1monw added a commit to s1monw/elasticsearch that referenced this issue Jan 11, 2016
We fail today with ClusterBlockExceptions if an alias expands to a closed index
during search since we miss to check the index option down the road after we expanded
aliases.

Closes elastic#13278
s1monw added a commit that referenced this issue Jan 11, 2016
We fail today with ClusterBlockExceptions if an alias expands to a closed index
during search since we miss to check the index option down the road after we expanded
aliases.

Closes #13278
s1monw added a commit that referenced this issue Jan 11, 2016
We fail today with ClusterBlockExceptions if an alias expands to a closed index
during search since we miss to check the index option down the road after we expanded
aliases.

Closes #13278
s1monw added a commit that referenced this issue Jan 11, 2016
We fail today with ClusterBlockExceptions if an alias expands to a closed index
during search since we miss to check the index option down the road after we expanded
aliases.

Closes #13278
@clintongormley clintongormley added :Data Management/Indices APIs APIs to create and manage indices and templates and removed :Aliases labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants