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

Comments

Projects
None yet
4 participants
@bradvido
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

commented Sep 5, 2015

@javanna any ideas here?

@javanna

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

commented Oct 15, 2015

Nice, thanks for the confirmation

@oferbar

This comment has been minimized.

Copy link

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

Check lenient_expand_open after aliases have been resolved
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

Check lenient_expand_open after aliases have been resolved
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

Check lenient_expand_open after aliases have been resolved
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

Check lenient_expand_open after aliases have been resolved
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

Check lenient_expand_open after aliases have been resolved
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.