-
Notifications
You must be signed in to change notification settings - Fork 25.6k
EQL: Wrap a verification_exception in an index_not_found_exception in case there is no valid index available #64212
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
Conversation
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.
|
Pinging @elastic/es-ql (:Query Languages/EQL) |
| @Override | ||
| public void onFailure(Exception e) { | ||
| Exception finalException = e; | ||
| if (e instanceof IndexNotFoundException) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
costin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@elasticmachine update branch |
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.