-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Can't get text on a START OBJECT (please improve error handling for key=>{} case) #41372
Comments
@Mekk Thanks for reporting this issue. I agree that the error message should be improved, along the line of On top of that like you describe a |
Pinging @elastic/es-search |
As a note, this issue is related to #12366, where we decided to add support for |
This issue would be fixed by #12366 but in the mean time it would be good to improve the error message here especially as the error message would still be relevant when |
Regarding the fix of error message: PLEASE QUOTE THE PROBLEMATIC VALUE. No matter what. Quote it. Please. Quote it. Escape if necessary, truncate if necessary, but quote it. Please. |
Also it would not hurt to name the index, and mayhaps the mapping. Some suggestion for the error message:
(and java stacktrace doesn't seem to be necessary, and linked help page tells about ignore_malformed, and about dead letter queue, and about typical incompatibilities…) In case of ignore malformed, similar note would also be nice ( |
Hi, I looked a bit on what has to be adjusted for this change. Since every implementation of Just for the purposes of communication I pushed the dirty draft of this approach in my fork https://github.com/Sandmannn/elasticsearch/compare/master...Sandmannn:extend-logging-misread?expand=1 It may make sense to align on approach before starting the refactoring in all the inheritors of |
@sandmannn Thanks for taking a look at this. For starting, I would suggest a little simpler approach with code changes only in In the catch exception section of this function, may be it would be just enough to look at |
@mayya-sharipova that approach is indeed more simple and elegant. We should follow it if possible. One small question though: It implicitly assumes that the implementations of |
@sandmannn Right, I think we can assume that future implementations of |
So I guess I would go on creating a PR according to the current plan, or? |
@sandmannn Thanks, please go ahead creating a PR according to the current plan. |
Closing this out now that #42321 has merged. The PR adds a preview of the field value to the error message. This should help to clarify the confusing error message mentioned in the issue description ("Can't get text on a START OBJECT"). This issue also suggested extending |
What happened
Once more I pushed some logstash changes just to see my logs filled with errors
It took me an hour (to setup dead-letter-queue and write logstash config to prettyprint it's contents) to find out what happened. And it happened that I accidentally constructed
(where component is usually short text and is mapped as keyword).
I face this third or fourth time, nevertheless every time I am deeply confused.
What I would be grateful for
There are a few things which seem easy, but would improve the situation very noticeably:
In case field can't be parsed, Elastic error message really could quote the problematic value. This would be a giant improvement (not just here but also in all those bad number/bad date/… cases), especially in ELK setups (where there is no easy way to find the event source).
As keyword parsing can fail, it should be possible to write in mapping
"component": { "type": "keyword", "ignore_malformed": true },
(I tried, my mapping was rejected with syntax error, looks like for keywords this
setting is illegal just now)
Both ignoring it, and stringifying it in any way, would be welcome.
Realistic use case (for curious)
Sending empty dictionary instead of text seems strange and unlikely, but rather simple logstash code happens to do. I use
(I need disabled suppress_empty as I have some meaningful
<flag-like-tags/>
to probe for in rules used later). Then I copy some values, in particular this very case is related toIt works fine for messages where
<component>
is missing (no such field in parsed xml, so nothing to copy), it works fine for messages like(proper copy of
something
) but from time to time something logsand buuuum, I get empty dictionary.
The text was updated successfully, but these errors were encountered: