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

Provide more information on _failed_to_convert_ exceptions #21946

Closed
ppf2 opened this issue Dec 2, 2016 · 6 comments
Closed

Provide more information on _failed_to_convert_ exceptions #21946

ppf2 opened this issue Dec 2, 2016 · 6 comments
Labels
:Core/Infra/Logging Log management and logging utilities >enhancement help wanted adoptme

Comments

@ppf2
Copy link
Member

ppf2 commented Dec 2, 2016

https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/index/IndexingSlowLog.java#L187

[2016-12-01 13:44:14,966][WARN ][index.indexing.slowlog.index] [node_name] [index][2] took[1.3m], took_millis[83880], type[match], id[AVi8VwvBCah0Po5KgBmM], routing[], source[source[_failed_to_convert_]

When we get the failed_to_convert message in the slowlog entry for indexing, it doesn't provide any information on what part of the document it has trouble json-ing. It will be helpful to provide some pointers so the end user can go check their source/ingest pipeline, etc..

@ppf2 ppf2 added :Core/Infra/Logging Log management and logging utilities >enhancement labels Dec 2, 2016
@clintongormley clintongormley added the help wanted adoptme label Dec 12, 2016
@kunal642
Copy link
Contributor

kunal642 commented Apr 27, 2017

any suggestions on what the failure message should be like?

@liketic
Copy link

liketic commented Oct 5, 2017

Hi @ppf2 Can I work on this? I think at least, we can put the exception message to source. Any thoughts about this? Thanks. 😃

@cbuescher
Copy link
Member

@ppf2 Here's an example of the way the error is logged currently for invalid json. For invalid json, e.g. the invalid token in the tests, currently we print:

[foo/123] took[10nanos], took_millis[0], type[test], id[id], routing[], source[_failed_to_convert_]

whereas with this change we would get the exception message as well:

[foo/123] took[10nanos], took_millis[0], type[test], id[id], routing[], source[_failed_to_convert_[Unrecognized token 'invalid': was expecting ('true', 'false' or 'null')
 at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@171f40bc; line: 1, column: 15]]], reformat[true], x_content_type[JSON]

Do you think that is helpful enough to close your issue?

@ppf2
Copy link
Member Author

ppf2 commented Nov 1, 2017

Thanks, I think Unrecognized token 'invalid': was expecting ('true', 'false' or 'null') will be useful. Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@171f40bc; line: 1, column: 15]] For this part, it will be more useful if we can print out the actual content (or just small snippet of the content starting at where it is failing the parsing) instead of the column number. But certainly, just having the exception returned is a good start. Thx!

@cbuescher
Copy link
Member

it will be more useful if we can print out the actual content (or just small snippet of the content starting at where it is failing the parsing)

This is not going to be easy, since printing the "_source" in json form is the operation we are failing on here in the first place. So I think we'll have to go with the exception message here.

@ppf2
Copy link
Member Author

ppf2 commented Nov 2, 2017

Sounds good, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Logging Log management and logging utilities >enhancement help wanted adoptme
Projects
None yet
Development

No branches or pull requests

5 participants