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

ntp plugin crash #1634

Closed
gmr opened this issue Aug 16, 2016 · 1 comment · Fixed by #1635
Closed

ntp plugin crash #1634

gmr opened this issue Aug 16, 2016 · 1 comment · Fixed by #1635
Labels
bug unexpected problem or unintended behavior

Comments

@gmr
Copy link

gmr commented Aug 16, 2016

A parse error in the ntp plugin caused a telegraf agent to crash.

Relevant telegraf.conf:

[[inputs.ntpq]]
#   ## If false, set the -n ntpq flag. Can reduce metric gather time.
#   dns_lookup = true

System info:

Telegraf - version 0.13.1
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"

Steps to reproduce:

I'm guessing an unexpected response from the call the agent makes to grab NTP info causes the crash to happen.

Expected behavior:

Agent doesn't crash

Actual behavior:

Agent Crashes

Additional info:

2016/08/15 09:46:00 ERROR ntpq: parsing int: 77.759
panic: runtime error: index out of range

goroutine 2202595 [running]:
panic(0x107ebc0, 0xc820010080)
    /usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/influxdata/telegraf/plugins/inputs/ntpq.(*NTPQ).Gather(0xc8204da660, 0x7f5ecebaa368, 0xc82078c000, 0x0, 0x0)
    /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/ntpq/ntpq.go:175 +0xc90
github.com/influxdata/telegraf/agent.gatherWithTimeout.func1(0xc820558120, 0xc8201d0c60, 0xc82078c000)
    /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:174 +0x73
created by github.com/influxdata/telegraf/agent.gatherWithTimeout
    /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:175 +0xe0
@sparrc sparrc added the bug unexpected problem or unintended behavior label Aug 16, 2016
sparrc added a commit that referenced this issue Aug 16, 2016
@sparrc
Copy link
Contributor

sparrc commented Aug 16, 2016

thanks for the report, I was able to reproduce in a unit test and I'll have a fix up in master shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants