Skip to content

Boom!! runtime error: invalid memory address or nil pointer dereference - v0.30.8 #2428

@Loth4r

Description

@Loth4r




Describe the bug
k9s is crashing for me after update from 0.29.1 to v0.30.8 when switching through namespaces with following message: Boom!! runtime error: invalid memory address or nil pointer dereference

To Reproduce
Steps to reproduce the behavior:

  1. Launch k9s and type :namespaces to see namespaces view
  2. Go to any namespace hit enter -> error occurs -> Boom!! runtime error: invalid memory address or nil pointer dereference
  3. Launch k9s again and type :namespaces to see namespaces view
  4. Select same namespace as in point 2 -> view is working
  5. Get back to namespaces view again and select any other namespace -> Boom!! runtime error: invalid memory address or nil pointer dereference

Expected behavior
Browsing namespace works on the first try.

Versions (please complete the following information):

  • OS: OSX Sonoma 14.2.1
  • K9s: v0.30.8
  • K8s: v1.27.3

Additional context

Results of running k9s --logLevel debug --logFile k9s_0.30.8.log

1:55AM INF 🐶 K9s starting up... 11:55AM DBG Found existing context config: "/Users/test_user/Library/Application Support/k9s/clusters/test-cluster/test-cluster/config.yaml" 11:55AM DBG Active Context "test-cluster" 11:55AM INF ✅ Kubernetes connectivity 11:55AM DBG No custom skin found. Using stock skin 11:55AM DBG Factory START with ns "test-ns"
11:55AM DBG Fetching latest k9s rev...
11:55AM DBG K9s latest rev: "v0.30.8"
11:55AM DBG ConfigWatcher watching: "/Users/test_user/Library/Application Support/k9s/config.yaml"
11:55AM DBG ConfigWatcher watching: "/Users/test_user/Library/Application Support/k9s/clusters/test-cluster/test-cluster/config.yaml"
11:55AM WRN CustomView watcher failed error="open /Users/test_user/Library/Application Support/k9s/views.yaml: no such file or directory"
11:55AM DBG ConfigWatcher file changed: /Users/test_user/Library/Application Support/k9s/clusters/test-cluster/test-cluster/config.yaml -- "WRITE"
11:55AM DBG Found existing context config: "/Users/test_user/Library/Application Support/k9s/clusters/test-cluster/test-cluster/config.yaml"
11:55AM DBG ConfigWatcher file changed: /Users/test_user/Library/Application Support/k9s/config.yaml -- "WRITE|CHMOD"
11:55AM DBG No custom skin found. Using stock skin
11:55AM DBG No custom skin found. Using stock skin
11:55AM DBG ConfigWatcher file changed: /Users/test_user/Library/Application Support/k9s/clusters/test-cluster/test-cluster/config.yaml -- "WRITE"
11:55AM DBG Found existing context config: "/Users/test_user/Library/Application Support/k9s/clusters/test-cluster/test-cluster/config.yaml"
11:55AM DBG ConfigWatcher file changed: /Users/test_user/Library/Application Support/k9s/config.yaml -- "WRITE"
11:55AM DBG ConfigWatcher file changed: /Users/test_user/Library/Application Support/k9s/clusters/test-cluster/test-cluster/config.yaml -- "WRITE|CHMOD"
11:55AM DBG Found existing context config: "/Users/test_user/Library/Application Support/k9s/clusters/test-cluster/test-cluster/config.yaml"
11:55AM ERR Boom! runtime error: invalid memory address or nil pointer dereference
11:55AM DBG ConfigWatcher file changed: /Users/test_user/Library/Application Support/k9s/config.yaml -- "WRITE|CHMOD"
11:55AM ERR goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x64
github.com/derailed/k9s/cmd.run.func2()
github.com/derailed/k9s/cmd/root.go:84 +0x9c
panic({0x106490bc0?, 0x1089b51e0?})
runtime/panic.go:914 +0x218
github.com/derailed/tview.(*Application).Run.func1()
github.com/derailed/tview@v0.8.2/application.go:243 +0x4c
panic({0x106490bc0?, 0x1089b51e0?})
runtime/panic.go:914 +0x218
github.com/derailed/k9s/internal/config.(*K9s).ActiveContextNamespace(...)
github.com/derailed/k9s/internal/config/k9s.go:152
github.com/derailed/k9s/internal/config.(*Config).ActiveNamespace(0x14000e4adb0?)
github.com/derailed/k9s/internal/config/config.go:132 +0x28
github.com/derailed/k9s/internal/view.(*Command).run(0x14000e4adb0, 0x14001a87400, {0x0, 0x0}, 0x80?)
github.com/derailed/k9s/internal/view/command.go:139 +0xdc
github.com/derailed/k9s/internal/view.(*App).gotoResource(0x14000b5fc20, {0x1054eadac, 0x4}, {0x0, 0x0}, 0x2?)
github.com/derailed/k9s/internal/view/app.go:688 +0x84
github.com/derailed/k9s/internal/view.(*Namespace).switchNs(0x14001a87558?, 0x105351cf8?, {0x1000002d5?, 0x14000dc8900?}, {{0x14001a875b8, 0x102ce72b8}, {0x14001a87588, 0x1052d0ac0}, {0x14000dbcd60, 0x14001a87540}, ...}, ...)
github.com/derailed/k9s/internal/view/ns.go:46 +0x4c
github.com/derailed/k9s/internal/view.(*Browser).enterCmd(0x14000e56300, 0x14001a876d6?)
github.com/derailed/k9s/internal/view/browser.go:330 +0xe8
github.com/derailed/k9s/internal/view.(*Table).keyboard(0x14000abd280, 0x140004fece0)
github.com/derailed/k9s/internal/view/table.go:90 +0x120
github.com/derailed/k9s/internal/view.(*Browser).InputHandler.(*Table).InputHandler.(*Box).WrapInputHandler.func2(0x14001a87768?, 0x1053cd620?)
github.com/derailed/tview@v0.8.2/box.go:179 +0x3c
github.com/derailed/k9s/internal/view.(*PageStack).InputHandler.(*Pages).InputHandler.func1(0x110da3f58?, 0x14000dd3380?)
github.com/derailed/tview@v0.8.2/pages.go:332 +0xa8
github.com/derailed/k9s/internal/view.(*PageStack).InputHandler.(*Pages).InputHandler.(*Box).WrapInputHandler.func2(0x14001a877e8?, 0x103f55900?)
github.com/derailed/tview@v0.8.2/box.go:182 +0x54
github.com/derailed/tview.(*Flex).InputHandler.func1(0x14001a87878?, 0x4?)
github.com/derailed/tview@v0.8.2/flex.go:261 +0xd0
github.com/derailed/tview.(*Flex).InputHandler.(*Box).WrapInputHandler.func2(0x14000dd2810?, 0xeccc?)
github.com/derailed/tview@v0.8.2/box.go:182 +0x54
github.com/derailed/k9s/internal/ui.(*Pages).InputHandler.(*Pages).InputHandler.func1(0x10?, 0x106595d60?)
github.com/derailed/tview@v0.8.2/pages.go:332 +0xa8
github.com/derailed/k9s/internal/ui.(*Pages).InputHandler.(*Pages).InputHandler.(*Box).WrapInputHandler.func2(0x14001a879e0?, 0x14001a87920?)
github.com/derailed/tview@v0.8.2/box.go:182 +0x54
github.com/derailed/tview.(*Application).Run(0x14000238d20)
github.com/derailed/tview@v0.8.2/application.go:334 +0x470
github.com/derailed/k9s/internal/view.(*App).Run(0x14000b5fc20)
github.com/derailed/k9s/internal/view/app.go:530 +0x90
github.com/derailed/k9s/cmd.run(0x14000209100?, {0x1054ead04?, 0x4?, 0x1054eac20?})
github.com/derailed/k9s/cmd/root.go:102 +0x40c
github.com/spf13/cobra.(*Command).execute(0x1089e80e0, {0x1400010e060, 0x4, 0x4})
github.com/spf13/cobra@v1.8.0/command.go:983 +0x840
github.com/spf13/cobra.(*Command).ExecuteC(0x1089e80e0)
github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/derailed/k9s/cmd.Execute(...)
github.com/derailed/k9s/cmd/root.go:59
main.main()
github.com/derailed/k9s/main.go:32 +0x28
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions