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

Runtime error 'index out of range' while gathering CPUStats #3282

Closed
heshsmurf opened this issue Sep 29, 2017 · 4 comments · Fixed by #3306
Closed

Runtime error 'index out of range' while gathering CPUStats #3282

heshsmurf opened this issue Sep 29, 2017 · 4 comments · Fixed by #3306
Labels
bug unexpected problem or unintended behavior panic issue that results in panics from Telegraf
Milestone

Comments

@heshsmurf
Copy link

Bug report

I'm running telegraf on node and it fails after a while.

panic: runtime error: index out of range

goroutine 680 [running]:
github.com/influxdata/telegraf/plugins/inputs/system.(*CPUStats).Gather(0xc420294ff0, 0x1c2b160, 0xc42040c480, 0x11e5d80, 0xc4209ec600)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/system/cpu.go:89 +0x1260
github.com/influxdata/telegraf/agent.gatherWithTimeout.func1(0xc420413140, 0xc420127300, 0xc42040c480)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:153 +0x49
created by github.com/influxdata/telegraf/agent.gatherWithTimeout
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:154 +0xcc

Relevant telegraf.conf:

[[inputs.cpu]]
  percpu = true
  totalcpu = false
  collect_cpu_time = false
  report_active = false

System info:

Telegraf v1.4.1, Linux version 4.4.0-96-generic (buildd@lgw01-10)

Steps to reproduce:

  1. Start telegraf as a daemon
@danielnelson
Copy link
Contributor

I can see where this would fail if the number of CPUs in /proc/stat changed over time, is this something that is possibly happening?

@danielnelson danielnelson added bug unexpected problem or unintended behavior panic issue that results in panics from Telegraf labels Sep 29, 2017
@danielnelson danielnelson added this to the 1.4.2 milestone Sep 29, 2017
@heshsmurf
Copy link
Author

Actually I run telegraf on virtual machine, so that behavior seems possible

@danielnelson
Copy link
Contributor

Interesting, can I ask which hypervisor you are using?

@heshsmurf
Copy link
Author

VM is running under LXC

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 panic issue that results in panics from Telegraf
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants