
Describe the bug
K9s crashes when trying to list a cluster's nodes:
Boom!! runtime error: invalid memory address or nil pointer dereference.
It works on other clusters. The cluster on which it is crashing has one broken master with status NotReady,SchedulingDisabled but I have no idea if that is the actual issue.
To Reproduce
Steps to reproduce the behavior:
:noExpected behavior
List cluster's nodes.
Versions (please complete the following information):
Additional context
Bottom of debug log from k9s -l debug --context <cluster> -c no
3:44PM DBG RECONCILE "-":"v1/nodes" elapsed 841.8571ms
3:44PM ERR Boom! runtime error: invalid memory address or nil pointer dereference
3:44PM ERR goroutine 1 [running]:
runtime/debug.Stack(0x2c0c6a0, 0x1b37e03, 0x0)
/usr/local/Cellar/go/1.13.5/libexec/src/runtime/debug/stack.go:24 +0x9d
github.com/derailed/k9s/cmd.run.func1()
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:73 +0x11d
panic(0x1911820, 0x2bdb4b0)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/dao/node.go:51 +0x35f
github.com/derailed/k9s/internal/model.(*Table).list(0xc0008303c0, 0x1df3ec0, 0xc000a70240, 0x1df4380, 0xc0006f45a0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/table.go:211 +0x20d
github.com/derailed/k9s/internal/model.(*Table).reconcile(0xc0008303c0, 0x1df3ec0, 0xc000a70240, 0x0, 0x0)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/table.go:220 +0x112
github.com/derailed/k9s/internal/model.(*Table).refresh(0xc0008303c0, 0x1df3ec0, 0xc000a70240)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/table.go:192 +0xba
github.com/derailed/k9s/internal/model.(*Table).Refresh(...)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/table.go:131
github.com/derailed/k9s/internal/model.(*Table).Watch(0xc0008303c0, 0x1df3ec0, 0xc000a70240)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/table.go:70 +0x3f
github.com/derailed/k9s/internal/view.(*Browser).Start(0xc0005e70a0)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/view/browser.go:100 +0x169
github.com/derailed/k9s/internal/view.(*PageStack).StackPushed(0xc0000a9ac0, 0x7f9355be6d30, 0xc0008b0340)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/view/page_stack.go:36 +0x35
github.com/derailed/k9s/internal/model.(*Stack).notify(0xc00089c510, 0x1, 0x7f9355be6d30, 0xc0008b0340)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/stack.go:161 +0x101
github.com/derailed/k9s/internal/model.(*Stack).Push(0xc00089c510, 0x7f9355be6d30, 0xc0008b0340)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/stack.go:97 +0xa3
github.com/derailed/k9s/internal/view.(*App).inject(0xc000281540, 0x7f9355be6d30, 0xc0008b0340, 0x1b, 0xc00027c420)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/view/app.go:434 +0x1ba
github.com/derailed/k9s/internal/view.(*Command).exec(0xc000262060, 0xc0008972d0, 0x8, 0x7f9355be6d30, 0xc0008b0340, 0xc0008b0301, 0x0, 0x0)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/view/command.go:166 +0x380
github.com/derailed/k9s/internal/view.(*Command).run(0xc000262060, 0x7fffc86d6215, 0x2, 0x1, 0xc000000180, 0x16ce402)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/view/command.go:72 +0x40f
github.com/derailed/k9s/internal/view.(*Command).defaultCmd(0xc000262060, 0x1bfd348, 0xc000281540)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/view/command.go:87 +0x48
github.com/derailed/k9s/internal/view.(*App).Run(0xc000281540)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/view/app.go:303 +0x127
github.com/derailed/k9s/cmd.run(0x2bedd60, 0xc0000c0600, 0x0, 0x6)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:88 +0x145
github.com/spf13/cobra.(*Command).execute(0x2bedd60, 0xc0000c4010, 0x6, 0x6, 0x2bedd60, 0xc0000c4010)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:830 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0x2bedd60, 0x0, 0x0, 0x0)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:88 +0x145
github.com/spf13/cobra.(*Command).execute(0x2bedd60, 0xc0000c4010, 0x6, 0x6, 0x2bedd60, 0xc0000c4010)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:830 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0x2bedd60, 0x0, 0x0, 0x0)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:864
github.com/derailed/k9s/cmd.Execute()
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:63 +0x2d
main.main()
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/main.go:25 +0x1a6
Same om macOS
A coworker I'm trying to help remotely is having this issue as well.
What's worse, is that after it happens, he can't start k9s again, as it defaults to using the last used filter on startup (:no in this case)
Is there a way to force k9s to start with the pods view regardless of the last selected view?
Use ' k9s -c pods', must work as a quick fix
@hsychla @cbwebdevelopment @cbwebdevelopment. Yes that's my bad! Had some issues with the metrics checks in this release. I've ran into it as well and others did flag it. This should be fixed on the next drop.
@Keramblock Thank you for the help and pointer! Much appreciated!!
Most helpful comment
@hsychla @cbwebdevelopment @cbwebdevelopment. Yes that's my bad! Had some issues with the metrics checks in this release. I've ran into it as well and others did flag it. This should be fixed on the next drop.
@Keramblock Thank you for the help and pointer! Much appreciated!!