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

Segmentation fault on kubernetes module #549

Closed
Draiken opened this issue Aug 28, 2019 · 6 comments · Fixed by #615
Closed

Segmentation fault on kubernetes module #549

Draiken opened this issue Aug 28, 2019 · 6 comments · Fixed by #615
Labels
🐛 bug "Houston, we've had a problem."

Comments

@Draiken
Copy link

Draiken commented Aug 28, 2019

What's broken?

wtfutil crashes when enabling the kubernetes module

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x45d55a]

goroutine 49 [running]:
k8s.io/client-go/kubernetes.NewForConfig(0x0, 0x0, 0xc000501e30, 0xe)
	/Users/ccummer/go/pkg/mod/k8s.io/[email protected]+incompatible/kubernetes/clientset.go:335 +0x4e
github.com/wtfutil/wtf/modules/kubernetes.(*Widget).getKubeClient(0xc0004e95c0, 0xc00059c030, 0xc000507608)
	/Users/ccummer/go/src/github.com/wtfutil/wtf/modules/kubernetes/client.go:32 +0x58
github.com/wtfutil/wtf/modules/kubernetes.(*Widget).getInstance.func1()
	/Users/ccummer/go/src/github.com/wtfutil/wtf/modules/kubernetes/client.go:22 +0x42
sync.(*Once).Do(0x2fe6c18, 0xc000507638)
	/usr/local/Cellar/go/1.12.7/libexec/src/sync/once.go:44 +0xb3
github.com/wtfutil/wtf/modules/kubernetes.(*Widget).getInstance(0xc0004e95c0, 0xc0003aa240)
	/Users/ccummer/go/src/github.com/wtfutil/wtf/modules/kubernetes/client.go:19 +0x55
github.com/wtfutil/wtf/modules/kubernetes.(*Widget).Refresh(0xc0004e95c0)
	/Users/ccummer/go/src/github.com/wtfutil/wtf/modules/kubernetes/widget.go:46 +0x65
github.com/wtfutil/wtf/app.Schedule(0x1f580a0, 0xc0004e95c0)
	/Users/ccummer/go/src/github.com/wtfutil/wtf/app/scheduler.go:12 +0x49
created by github.com/wtfutil/wtf/app.(*WtfApp).scheduleWidgets
	/Users/ccummer/go/src/github.com/wtfutil/wtf/app/wtf_app.go:119 +0x81

kubectl version (not sure it's needed)

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.9", GitCommit:"3e4f6a92de5f259ef313ad876bb008897f6a98f0", GitTreeState:"clean", BuildDate:"2019-08-05T09:22:00Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

wtfutil: 0.20.0
OS: Arch Linux 5.2.5-arch1-1-ARCH
config:

    kubernetes:
      enabled: true
      kubeconfig: ~/.kube/config
      namespaces: ["default"]
      objects: ["deployments"]
      position:
        top: 0
        left: 6
        height: 2
        width: 2
@senorprogrammer senorprogrammer added the 🐛 bug "Houston, we've had a problem." label Aug 28, 2019
@S-Collison
Copy link

I had the same issue when I used ~/ to point to the kube config file. It worked as soon as I used the full path.

@Draiken
Copy link
Author

Draiken commented Aug 29, 2019

That was my first instinct too, but even after switching to the full path, it crashed wtfutils (and broke my shell)

@ruslanbes
Copy link

ruslanbes commented Aug 29, 2019

Getting pretty similar crash on Mac (the initial error is a bit different but also in getKubeClient). Wtfutil version: dev, kubernetes_config.yml is taken from the _sample_configs on git (only adjusted the username). kubectl version: 1.14.3

I can post more details if needed.

@senorprogrammer
Copy link
Collaborator

I can reproduce this by just adding Kubernetes config to my config file and trying to read it (I have no ~/.kube directory or Kubernetes config file on my machine).

@Seanstoppable
Copy link
Collaborator

Master should catch a previously uncaught error and render it properly. However, I don't use Kubernetes, so if someone could test it out, that would be most appreciated.

@ruslanbes
Copy link

I tested the branch of #615 and the SegFault was fixed for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug "Houston, we've had a problem."
Development

Successfully merging a pull request may close this issue.

5 participants