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

kube_inventory: invalid memory address or nil pointer dereference #9537

Closed
tomklapka opened this issue Jul 23, 2021 · 6 comments · Fixed by #9585
Closed

kube_inventory: invalid memory address or nil pointer dereference #9537

tomklapka opened this issue Jul 23, 2021 · 6 comments · Fixed by #9585
Assignees
Labels
area/prometheus bug unexpected problem or unintended behavior waiting for response waiting for response from contributor

Comments

@tomklapka
Copy link

Relevant telegraf.conf:

[agent]
      interval = "1m"
      flush_interval = "10s"
      metric_buffer_limit = 100000
      metric_batch_size = 10000
      debug = false
    [[outputs.influxdb_v2]]
      urls = ["https://us-central1-1.gcp.cloud2.influxdata.com"]
      organization = ""
      bucket = ""
      token = ""
    [[inputs.kube_inventory]]
      url = "https://kubernetes.default"
      bearer_token = "/run/secrets/kubernetes.io/serviceaccount/token"
      namespace = ""
      insecure_skip_verify = true
      resource_exclude = []
      resource_include = []

System info:

bare-metal ARM64 K8s Cluster v1.19.0, Ubuntu 20.04.1 LTS, Kernel: 5.4.0-1022-raspi, docker://19.3.13
Telegraf 1.19.0, Telegraf 1.19.1

Actual behavior:

2021-07-23T14:00:27Z I! Starting Telegraf 1.19.0
2021-07-23T14:00:27Z I! Using config file: /etc/telegraf/telegraf.conf
2021-07-23T14:00:27Z I! Loaded inputs: kube_inventory prometheus
2021-07-23T14:00:27Z I! Loaded aggregators: 
2021-07-23T14:00:27Z I! Loaded processors: 
2021-07-23T14:00:27Z I! Loaded outputs: influxdb_v2
2021-07-23T14:00:27Z I! Tags enabled: host=telegraf-demo-789cf4499f-vflm7
2021-07-23T14:00:27Z I! [agent] Config: Interval:1m0s, Quiet:false, Hostname:"telegraf-demo-789cf4499f-vflm7", Flush Interval:30s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1a5e9bc]

goroutine 79 [running]:
github.com/influxdata/telegraf/plugins/inputs/kube_inventory.(*KubernetesInventory).gatherEndpoint(0x4000b8e000, 0x0, 0x0, 0x0, 0x0, 0x40003fe2f0, 0xa, 0x0, 0x0, 0x40003fe309, ...)
	/go/src/github.com/influxdata/telegraf/plugins/inputs/kube_inventory/endpoint.go:42 +0x82c
github.com/influxdata/telegraf/plugins/inputs/kube_inventory.collectEndpoints(0x48c0f40, 0x400018e000, 0x48efb78, 0x40002f14e0, 0x4000b8e000)
	/go/src/github.com/influxdata/telegraf/plugins/inputs/kube_inventory/endpoint.go:18 +0xe0
github.com/influxdata/telegraf/plugins/inputs/kube_inventory.(*KubernetesInventory).Gather.func1(0x4000ab8144, 0x48c0f40, 0x400018e000, 0x48efb78, 0x40002f14e0, 0x4000b8e000, 0x41c37d8)
	/go/src/github.com/influxdata/telegraf/plugins/inputs/kube_inventory/kube_state.go:141 +0x78
created by github.com/influxdata/telegraf/plugins/inputs/kube_inventory.(*KubernetesInventory).Gather
	/go/src/github.com/influxdata/telegraf/plugins/inputs/kube_inventory/kube_state.go:139 +0x21c

Additional info:

@tomklapka tomklapka added the bug unexpected problem or unintended behavior label Jul 23, 2021
@corklu
Copy link

corklu commented Jul 23, 2021

I see this behavior too for the kube_inventory input; but instead of endpoints, it's persistentclaimvolumes that throw the errors.

@akrantz01 akrantz01 self-assigned this Jul 27, 2021
@akrantz01
Copy link
Contributor

@tomklapka Please update to 1.19.1; it should be fixed there.

@akrantz01
Copy link
Contributor

@corklu could you test #9549, it should fix your issue. The built artifacts can be found here.

@sjwang90
Copy link
Contributor

Closed in #9549

@tomklapka
Copy link
Author

@tomklapka Please update to 1.19.1; it should be fixed there.

Same issue persists in 1.19.1 as I wrote in description.

@akrantz01
Copy link
Contributor

Could you send the error you get on 1.19.1?

@akrantz01 akrantz01 added the waiting for response waiting for response from contributor label Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prometheus bug unexpected problem or unintended behavior waiting for response waiting for response from contributor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants