-
Notifications
You must be signed in to change notification settings - Fork 25.2k
PainlessExplainError is cryptic inside elasticsearch log #28820
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
Comments
/cc @elastic/es-core-infra |
It seems to me that the error should not be logged. It's just a side effect of using Error for another purpose than to indicate a serious problem. I've looked through the code, but I can't find where we could check for PainlessExplainError and skip logging. Any idea where I could look? |
Here's some more context. The "logging" I was referring to (apparently, as I don't quite remember what I saw when writing this issue) was the rest response:
So the confusion is with the |
PainlessExplainError is constructed directly as part of the Java ASM generated for a script. As @rjernst mentions these could checked for as part of an instanceof instruction on the Throwable in PainlessScriptEngine.convertToScriptException. In that method we can change the behavior. As for not logging it all, I don't think we necessarily want to do that as there may be users find having these messages logged useful. |
is this issue still open? I'm new and would like to do it |
Hello, how can i replicate this error? What should I do to make it appear? Thanks |
Hi @larissabinatti try the reproduction provided by @rjernst in #28820 (comment) |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
PainlessExplainError is used when Debug.explain is called within a painless script. In json responses, this gives a toString of the passed in object. However, the Error is logged, but PainlessExplainError always has a null message. Either these errors should somehow be skipped when logging (as they are "expected") or we should generated a useful message to pass to the super Error ctor.
The text was updated successfully, but these errors were encountered: