Skip to content

Conversation

@astefan
Copy link
Contributor

@astefan astefan commented Oct 27, 2020

In scenarios where Security is enabled in the cluster, a wildcard defined index pattern that gets resolved in a no-index result loses the original pattern and the error message contains a *, -* instead. This change wraps the original verification_exception that gets thrown while checking for valid indices in a index_not_found_exception in the REST layer (where also the original index pattern is available). The provided tests show the actual error messages that get thrown in different scenarios (with/without Security, with/without a wildcard index pattern, existent/inexistent index).
Fixes #63529.

in an index_not_found_exception providing also the original index pattern
that may be lost in the chain of filters involving the Security one.
@astefan astefan requested a review from costin October 27, 2020 12:39
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (:Query Languages/EQL)

@elasticmachine elasticmachine added the Team:QL (Deprecated) Meta label for query languages team label Oct 27, 2020
@Override
public void onFailure(Exception e) {
Exception finalException = e;
if (e instanceof IndexNotFoundException) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a comment on why this is needed.


public LogicalPlan preAnalyze(LogicalPlan plan, IndexResolution indices) {
// wrap a potential index_not_found_exception with a VerificationException (expected by client)
if (indices.isValid() == false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment is useful to indicate why the Verification exception is wrapped inside an infe

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@astefan
Copy link
Contributor Author

astefan commented Oct 28, 2020

@elasticmachine update branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Index name pattern not present in the error message

4 participants