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

k9s crash on m1 with index out of range [0] with length 0. #1654

Closed
samueltorres opened this issue Jul 12, 2022 · 13 comments
Closed

k9s crash on m1 with index out of range [0] with length 0. #1654

samueltorres opened this issue Jul 12, 2022 · 13 comments
Labels
bug Something isn't working

Comments

@samueltorres
Copy link




Describe the bug
On Mac M1, sometimes k9s just crashes:

❯ k9s
 ____  __.________
|    |/ _/   __   \______
|      < \____    /  ___/
|    |  \   /    /\___ \
|____|__ \ /____//____  >
        \/            \/

Boom!! runtime error: index out of range [0] with length 0.

I've pulled the logs and that seems tied to the tview package.

Logs:

10:54AM ERR goroutine 1 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x68
github.com/derailed/k9s/cmd.run.func2()
	github.com/derailed/k9s/cmd/root.go:69 +0x9c
panic({0x104e7cce0, 0x140018d0648})
	runtime/panic.go:838 +0x204
github.com/derailed/tview.(*Application).Run.func1()
	github.com/derailed/tview@v0.7.1/application.go:243 +0x54
panic({0x104e7cce0, 0x140018d0648})
	runtime/panic.go:838 +0x204
github.com/derailed/tview.(*TextView).Write(0x140007a47e0, {0x14001ea2100, 0x13, 0x100})
	github.com/derailed/tview@v0.7.1/textview.go:731 +0xa8c
fmt.Fprintf({0x105004538, 0x140007b4580}, {0x10463a54a, 0xb}, {0x140016e5618, 0x2, 0x2})
	fmt/print.go:205 +0x88
github.com/derailed/k9s/internal/ui.(*Prompt).write(0x140007b4580, {0x14002ef4060?, 0x140016e5678?}, {0x0?, 0x14000c80720?})
	github.com/derailed/k9s/internal/ui/prompt.go:206 +0x144
github.com/derailed/k9s/internal/ui.(*Prompt).update(0x14000c80680?, {0x14002ef4060?, 0x0?}, {0x0?, 0x14002ef4060?})
	github.com/derailed/k9s/internal/ui/prompt.go:192 +0x70
github.com/derailed/k9s/internal/ui.(*Prompt).BufferCompleted(0x14000cbc200?, {0x14002ef4060?, 0x8?}, {0x0?, 0xb?})
	github.com/derailed/k9s/internal/ui/prompt.go:214 +0x28
github.com/derailed/k9s/internal/model.(*CmdBuff).fireBufferCompleted(0x140005171f0)
	github.com/derailed/k9s/internal/model/cmd_buff.go:195 +0xb8
github.com/derailed/k9s/internal/model.(*CmdBuff).SetText(...)
	github.com/derailed/k9s/internal/model/cmd_buff.go:88
github.com/derailed/k9s/internal/model.(*FishBuff).fireSuggestionChanged(0x14000ce8810, {0x0?, 0x8?, 0x140016e57a0?})
	github.com/derailed/k9s/internal/model/fish_buff.go:132 +0x11c
github.com/derailed/k9s/internal/model.(*FishBuff).Notify(0x14000ce8810, 0x74?)
	github.com/derailed/k9s/internal/model/fish_buff.go:108 +0x64
github.com/derailed/k9s/internal/model.(*FishBuff).Add(0x14000ce8810, 0x502c438?)
	github.com/derailed/k9s/internal/model/fish_buff.go:114 +0x38
github.com/derailed/k9s/internal/ui.(*Prompt).keyboard(0x140007b4580, 0x140004420a0)
	github.com/derailed/k9s/internal/ui/prompt.go:142 +0x16c
github.com/derailed/tview.(*Box).WrapInputHandler.func1(0x140007a47e0?, 0x103e71740?)
	github.com/derailed/tview@v0.7.1/box.go:179 +0x40
github.com/derailed/tview.(*Flex).InputHandler.func1(0x140001a67e0?, 0x1400140f3b0?)
	github.com/derailed/tview@v0.7.1/flex.go:261 +0xd8
github.com/derailed/tview.(*Box).WrapInputHandler.func1(0x14000ce8090?, 0x12e3566d0?)
	github.com/derailed/tview@v0.7.1/box.go:182 +0x58
github.com/derailed/tview.(*Pages).InputHandler.func1(0x10?, 0x104d5f180?)
	github.com/derailed/tview@v0.7.1/pages.go:332 +0xac
github.com/derailed/tview.(*Box).WrapInputHandler.func1(0x14000b207e0?, 0x140016e5a30?)
	github.com/derailed/tview@v0.7.1/box.go:182 +0x58
github.com/derailed/tview.(*Application).Run(0x14000d7a000)
	github.com/derailed/tview@v0.7.1/application.go:334 +0x780
github.com/derailed/k9s/internal/view.(*App).Run(0x14000780e40)
	github.com/derailed/k9s/internal/view/app.go:478 +0x98
github.com/derailed/k9s/cmd.run(0x1062e1a00?, {0x104630a68?, 0x0?, 0x0?})
	github.com/derailed/k9s/cmd/root.go:83 +0x3c0
github.com/spf13/cobra.(*Command).execute(0x1062e1a00, {0x1400004e220, 0x0, 0x0})
	github.com/spf13/cobra@v1.4.0/command.go:860 +0x4ac
github.com/spf13/cobra.(*Command).ExecuteC(0x1062e1a00)
	github.com/spf13/cobra@v1.4.0/command.go:974 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.4.0/command.go:902
github.com/derailed/k9s/cmd.Execute()
	github.com/derailed/k9s/cmd/root.go:49 +0x2c
main.main()
	github.com/derailed/k9s/main.go:29 +0x20

To Reproduce
Steps to reproduce the behavior:
It happens sometimes without any explainable behavior.

Versions (please complete the following information):

  • OS: OSX on Mac M1
  • K9s: 0.25.21
  • K8s: 1.22

Additional context
Add any other context about the problem here.

@derailed derailed added the bug Something isn't working label Jul 17, 2022
@derailed
Copy link
Owner

@samueltorres Thank you for reporting this Samuel. Not sure I've got it so please checkout v0.26.0 and let us know if we're happier as I don't have an m1 on hand??

@samueltorres
Copy link
Author

Thanks, I'll let you know.
Thank you for this great product :) Can't live with it ❤️

@samueltorres
Copy link
Author

Unfortunately it continues to happen randomly :(

@derailed
Copy link
Owner

derailed commented Aug 1, 2022

@samueltorres Hum... Bummer ;( If you can add some repro steps here when it happens we might be able to zero in. Tx!!

@stevo-f3
Copy link

stevo-f3 commented Aug 9, 2022

It happens on linux too, reproduced with v0.25.18. Will update to latest and see if it can be reproduced.

Btw this issue is listed as fixed in 0.26.0 for some reason.

@azarudeena
Copy link

running v0.26.3 version in M1 no issues for me

@NickLarsenNZ
Copy link

NickLarsenNZ commented Sep 7, 2022

This has happened to me (v0.25.18), and I can't reproduce it. It occurred when I was filtering logs by typing /cid:11. I have run the same filter and it works fine.

I'm not using an M1.

@EladDolev
Copy link

happens to me to a few times a day
I don't remember it happened with v0.25.18 but it occurs on all versions v0.25.19 and later

@emilienkofman
Copy link

I was opening a ticket about that but it looks like I got the same:

error on stderr: Boom!! runtime error: index out of range [0] with length 0.

error log:

9:44AM INF 🐶 K9s starting up...
9:44AM INF ✅ Kubernetes connectivity
9:44AM WRN No context specific skin file found -- /home/emilien/.config/k9s/admin@k2000_skin.yml
9:44AM WRN No skin file found -- /home/emilien/.config/k9s/skin.yml. Loading stock skins.
9:44AM WRN Custom view load failed /home/emilien/.config/k9s/views.yml error="open /home/emilien/.config/k9s/views.yml: no such file or directory"
9:44AM WRN CustomView watcher failed error="no such file or directory"
9:44AM ERR Boom! runtime error: index out of range [0] with length 0
9:44AM ERR goroutine 1 [running]:
runtime/debug.Stack()
	/home/emilien/Workspace/go/src/runtime/debug/stack.go:24 +0x65
github.com/derailed/k9s/cmd.run.func2()
	/home/emilien/go/pkg/mod/github.com/derailed/k9s@v0.27.4/cmd/root.go:72 +0xb1
panic({0x32f9ec0, 0xc00a4a0fa8})
	/home/emilien/Workspace/go/src/runtime/panic.go:884 +0x213
github.com/derailed/tview.(*Application).Run.func1()
	/home/emilien/go/pkg/mod/github.com/derailed/tview@v0.8.1/application.go:243 +0x4d
panic({0x32f9ec0, 0xc00a4a0fa8})
	/home/emilien/Workspace/go/src/runtime/panic.go:884 +0x213
github.com/derailed/tview.(*TextView).reindexBuffer(0xc000dd2c60, 0xc8)
	/home/emilien/go/pkg/mod/github.com/derailed/tview@v0.8.1/textview.go:900 +0xded
github.com/derailed/tview.(*TextView).Draw(0xc000dd2c60, {0x38fe920, 0xc000aa8000})
	/home/emilien/go/pkg/mod/github.com/derailed/tview@v0.8.1/textview.go:988 +0x185
github.com/derailed/tview.(*Flex).Draw(0xc000f02750, {0x38fe920?, 0xc000aa8000})
	/home/emilien/go/pkg/mod/github.com/derailed/tview@v0.8.1/flex.go:211 +0x3a5
github.com/derailed/tview.(*Pages).Draw(0xc000dd6f00, {0x38fe920, 0xc000aa8000})
	/home/emilien/go/pkg/mod/github.com/derailed/tview@v0.8.1/pages.go:300 +0xda
github.com/derailed/tview.(*Application).draw(0xc000abf6c0)
	/home/emilien/go/pkg/mod/github.com/derailed/tview@v0.8.1/application.go:597 +0x15a
github.com/derailed/tview.(*Application).Run(0xc000abf6c0)
	/home/emilien/go/pkg/mod/github.com/derailed/tview@v0.8.1/application.go:343 +0x574
github.com/derailed/k9s/internal/view.(*App).Run(0xc000d67260)
	/home/emilien/go/pkg/mod/github.com/derailed/k9s@v0.27.4/internal/view/app.go:476 +0x9c
github.com/derailed/k9s/cmd.run(0x4caf460?, {0x348daeb?, 0x3?, 0x3?})
	/home/emilien/go/pkg/mod/github.com/derailed/k9s@v0.27.4/cmd/root.go:86 +0x2c5
github.com/spf13/cobra.(*Command).execute(0x4caf460, {0xc0001a4010, 0x3, 0x3})
	/home/emilien/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x4caf460)
	/home/emilien/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/home/emilien/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/derailed/k9s/cmd.Execute()
	/home/emilien/go/pkg/mod/github.com/derailed/k9s@v0.27.4/cmd/root.go:50 +0x25
main.main()
	/home/emilien/go/pkg/mod/github.com/derailed/k9s@v0.27.4/main.go:29 +0x17

k9s version does not give much information 😬 sorry about that (maybe I built it myself? I don't remember)

k9s version
 ____  __.________       
|    |/ _/   __   \______
|      < \____    /  ___/
|    |  \   /    /\___ \ 
|____|__ \ /____//____  >
        \/            \/ 

Version:    dev
Commit:     dev
Date:       n/a

thank you for the great tool anyway.

@derailed
Copy link
Owner

derailed commented Dec 8, 2023

@emilienkofman Not sure which version of k9s you are running ??? Doesn't look like the latest
Anyway... If you can add a repro that would be super. Tx!

@emilienkofman
Copy link

Unfortunately I have no specific scenario since this also happens from time to time... if I found a more specific case I'll let you know.

@fsologureng
Copy link

Same here. k9s started showing a previous view which was a describe of a pvc, then I switched to :pods and it crashed.
Version 0.29.1.
k9s crash screen capture

@derailed
Copy link
Owner

I think this can be closed as of v0.31.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants