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

Fix segfault in kube_inventory #9456

Merged
merged 2 commits into from Jul 6, 2021

Conversation

akrantz01
Copy link
Contributor

Required for all PRs:

  • Updated associated README.md.
  • Wrote appropriate unit tests.

resolves #9450

Fixes a segfault in kube_inventory due to a nil pointer dereference when an endpoint did not have a node name by checking if the pointer is not nil before dereferencing.

@akrantz01 akrantz01 added regression something that used to work, but is now broken fix pr to fix corresponding bug area/k8s labels Jun 30, 2021
@reimda reimda merged commit a0ec75a into influxdata:master Jul 6, 2021
reimda pushed a commit that referenced this pull request Jul 7, 2021
@imranismail
Copy link
Contributor

I still see this, not sure if it's related:

2021-07-08T20:17:48Z E! [inputs.kube_inventory] Error in plugin: the server could not find the requested resource
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x22d28fc]
goroutine 138 [running]:
github.com/influxdata/telegraf/plugins/inputs/kube_inventory.(*KubernetesInventory).gatherPersistentVolumeClaim(0xc000182b40, 0x0, 0x0, 0x0, 0x0, 0xc0015fec00, 0xe, 0x0, 0x0, 0xc0015fec10, ...)
	/go/src/github.com/influxdata/telegraf/plugins/inputs/kube_inventory/persistentvolumeclaim.go:42 +0x2dc
github.com/influxdata/telegraf/plugins/inputs/kube_inventory.collectPersistentVolumeClaims(0x56799e0, 0xc000076060, 0x56a7ef8, 0xc00051edc0, 0xc000182b40)
	/go/src/github.com/influxdata/telegraf/plugins/inputs/kube_inventory/persistentvolumeclaim.go:19 +0x158
github.com/influxdata/telegraf/plugins/inputs/kube_inventory.(*KubernetesInventory).Gather.func1(0xc00127e004, 0x56799e0, 0xc000076060, 0x56a7ef8, 0xc00051edc0, 0xc000182b40, 0x4fac928)
	/go/src/github.com/influxdata/telegraf/plugins/inputs/kube_inventory/kube_state.go:141 +0x87
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 +0x29b

@akrantz01
Copy link
Contributor Author

@imranismail From the looks of it that occurs in a different part of the kube_inventory plugin. Could you open a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/k8s fix pr to fix corresponding bug regression something that used to work, but is now broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

segfault on kube_inventory...
3 participants