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

panic: runtime error: slice bounds out of range [:4] with capacity 0 #9106

Closed
JonAnder83 opened this issue Apr 8, 2021 · 2 comments
Closed

Comments

@JonAnder83
Copy link

I'm running into this crash when I run telegraf with docker collection enabled

2021-04-08T19:24:36Z` I! Starting Telegraf 1.18.0
2021-04-08T19:24:36Z I! Using config file: /etc/telegraf/telegraf.conf
2021-04-08T19:24:36Z I! Loaded inputs: cpu disk diskio docker kernel mem net netstat processes swap system
2021-04-08T19:24:36Z I! Loaded aggregators:
2021-04-08T19:24:36Z I! Loaded processors:
2021-04-08T19:24:36Z I! Loaded outputs: influxdb
2021-04-08T19:24:36Z I! Tags enabled: host=jarvis
2021-04-08T19:24:36Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"jarvis", Flush Interval:10s
2021-04-08T19:24:36Z D! [agent] Initializing plugins
2021-04-08T19:24:36Z W! [inputs.docker] 'perdevice' setting is set to 'true' so 'blkio' and 'network' metrics willbe collected. Please set it to 'false' and use 'perdevice_include' instead to control this behaviour as 'perdevice' will be deprecated
2021-04-08T19:24:36Z W! [inputs.docker] 'total' setting is set to 'false' so 'blkio' and 'network' metrics will not be collected. Please set it to 'true' and use 'total_include' instead to control this behaviour as 'total' will be deprecated
2021-04-08T19:24:36Z D! [agent] Connecting outputs
2021-04-08T19:24:36Z D! [agent] Attempting connection to [outputs.influxdb]
2021-04-08T19:24:36Z D! [agent] Successfully connected to outputs.influxdb
2021-04-08T19:24:36Z D! [agent] Starting service inputs
panic: runtime error: slice bounds out of range [:4] with capacity 0

goroutine 57 [running]:
github.com/influxdata/telegraf/plugins/inputs/docker.parseContainerStats(0xc000c96000, 0x55c7c5df7678, 0xc0005d9e60, 0xc0002ecff0, 0xc0005bd380, 0x40, 0xc000365480, 0x3, 0x4, 0xc000532c90, ...)
        github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:742 +0x256a
github.com/influxdata/telegraf/plugins/inputs/docker.(*Docker).gatherContainerInspect(0xc000726480, 0xc0005bd380, 0x40, 0xc000a64300, 0x1, 0x4, 0xc000a622e8, 0x11, 0xc0005ac230, 0x47, ...)
        github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:630 +0x2ab
github.com/influxdata/telegraf/plugins/inputs/docker.(*Docker).gatherContainer(0xc000726480, 0xc0005bd380, 0x40, 0xc000a64300, 0x1, 0x4, 0xc000a622e8, 0x11, 0xc0005ac230, 0x47, ...)
        github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:557 +0x919
github.com/influxdata/telegraf/plugins/inputs/docker.(*Docker).Gather.func1(0xc000a5d480, 0xc000726480, 0x55c7c5df7678, 0xc0005d9e60, 0xc0005bd380, 0x40, 0xc000a64300, 0x1, 0x4, 0xc000a622e8, ...)
        github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:281 +0xbf
created by github.com/influxdata/telegraf/plugins/inputs/docker.(*Docker).Gather
        github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:279 +0x3f8

OS is Arch LINUX

Just let me know if there's any other info you might need to track this bug: It was working properly until an update to a later systemd version (I'm not entirely sure this is the cause)

systemd 248 (248-3-arch)
Linux jarvis 5.11.11-arch1-1 #1 SMP PREEMPT Tue, 30 Mar 2021 14:10:17 +0000 x86_64 GNU/Linux

@Aladex
Copy link
Contributor

Aladex commented Apr 9, 2021

I think it was fixed here #8692
Just check it with the latest nightly build

@JonAnder83
Copy link
Author

Yup, that fixed it. Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants