-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fix panic in elasticsearch input plugin #2954
Conversation
Fix lint Re-trigger build Tweak Fix lint Tweak Tweak
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.
Thanks for the bugfix. Why would the /_cat/master
not be available? I ask because maybe we can tell the user how they can fix this in the error.
e.setCatMaster(s + "/_cat/master") | ||
if err := e.setCatMaster(s + "/_cat/master"); err != nil { | ||
acc.AddError(fmt.Errorf("Unable to retrieve master node information.")) | ||
acc.AddError(fmt.Errorf(mask.ReplaceAllString(err.Error(), "http(s)://XXX:XXX@"))) |
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.
Since this is a single error, we would need to have a single AddError call, but since it is fatal just return the error.
@danielnelson But with that being said, there could be other reasons as to why the endpoint would return a non-response that I may be unaware of. ES always returns an error message though, so maybe we could just log that? Something like this:
|
@danielnelson I've removed the extra log entry and replaced it with a single one of the following format:
which I believe is more in line with the style of the existing error messages. |
(cherry picked from commit a7595c9)
Will be in 1.3.3 later this week. |
This introduces a fix for #2893. With this change, ES collection is skipped for the interval rather than telegraf crashing due to panic.
Required for all PRs: