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

Docker input panics with "slice bounds out of range" #9029

Closed
aleho opened this issue Mar 21, 2021 · 3 comments
Closed

Docker input panics with "slice bounds out of range" #9029

aleho opened this issue Mar 21, 2021 · 3 comments
Assignees
Labels
area/docker bug unexpected problem or unintended behavior

Comments

@aleho
Copy link

aleho commented Mar 21, 2021

Using inputs.docker fails with the following panic:

panic: runtime error: slice bounds out of range [:4] with capacity 0
goroutine 86 [running]:
github.com/influxdata/telegraf/plugins/inputs/docker.parseContainerStats(0xc000f0f200, 0x42dc618, 0xc00007c3a0, 0xc000d06000, 0xc0005663c0, 0x40, 0xc0000b47c0, 0x3, 0x4, 0xc0
        /go/src/github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:742 +0x256a
github.com/influxdata/telegraf/plugins/inputs/docker.(*Docker).gatherContainerInspect(0xc0005898c0, 0xc0005663c0, 0x40, 0xc00027a680, 0x1, 0x4, 0xc00055c060, 0x26, 0xc00067e0
        /go/src/github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:630 +0x29c
github.com/influxdata/telegraf/plugins/inputs/docker.(*Docker).gatherContainer(0xc0005898c0, 0xc0005663c0, 0x40, 0xc00027a680, 0x1, 0x4, 0xc00055c060, 0x26, 0xc00067e000, 0x4
        /go/src/github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:557 +0x919
github.com/influxdata/telegraf/plugins/inputs/docker.(*Docker).Gather.func1(0xc000476d90, 0xc0005898c0, 0x42dc618, 0xc00007c3a0, 0xc0005663c0, 0x40, 0xc00027a680, 0x1, 0x4, 0
        /go/src/github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:281 +0xbd
created by github.com/influxdata/telegraf/plugins/inputs/docker.(*Docker).Gather
        /go/src/github.com/influxdata/telegraf/plugins/inputs/docker/docker.go:279 +0x3f8

Relevant telegraf.conf:

[[inputs.docker]]
  endpoint = "unix:///var/run/docker.sock"

  container_names = [
    "some",
    "containers"
  ]

  gather_services = false
  source_tag = false
  container_name_include = []
  container_name_exclude = []
  timeout = "5s"
  perdevice = true
  total = false
  docker_label_include = []
  docker_label_exclude = []

System info:

Debian Buster
Telegraf 1.18.0
Docker CE 20.10.5

$ id telegraf
uid=996(telegraf) gid=995(telegraf) groups=995(telegraf),997(docker)
@aleho aleho added the bug unexpected problem or unintended behavior label Mar 21, 2021
@helenosheaa
Copy link
Member

helenosheaa commented Mar 22, 2021

I think this is a duplicate of this issue

There is a fix waiting to be merged for the issue above, once it's merged I will post a link to the nightly builds so you can test it out

@helenosheaa helenosheaa self-assigned this Mar 23, 2021
@helenosheaa
Copy link
Member

I'm going to close this issue due to the fix that was merged, if the issue is still present please reopen the issue

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

No branches or pull requests

2 participants