bcicen / ctop

Top-like interface for container metrics
https://ctop.sh
MIT License
15.6k stars 528 forks source link

Panic Error #279

Closed docgonzo2015 closed 2 years ago

docgonzo2015 commented 2 years ago

ctop


panic: runtime error: index out of range [1] with length 0 [recovered]
        panic: runtime error: index out of range [1] with length 0

goroutine 1 [running]:
main.panicExit()
        /home/bradley/work/bcicen/ctop/main.go:137 +0x6e
panic(0xb280e0, 0xc0000ac8b8)
        /usr/lib/go/src/runtime/panic.go:965 +0x1b9
github.com/bcicen/ctop/cwidgets/single.(*Env).Set(0xc0001fb1f0, 0xc0005500a0, 0x4a)
        /home/bradley/work/bcicen/ctop/cwidgets/single/env.go:32 +0x399
github.com/bcicen/ctop/cwidgets/single.(*Single).SetMeta(0xc0000724b0, 0xc000251ad0)
        /home/bradley/work/bcicen/ctop/cwidgets/single/main.go:58 +0x10b
github.com/bcicen/ctop/container.(*Container).SetUpdater(...)
        /home/bradley/work/bcicen/ctop/container/main.go:53
main.SingleView(0x0)
        /home/bradley/work/bcicen/ctop/grid.go:87 +0xeb
main.Display(0xc000066d80)
        /home/bradley/work/bcicen/ctop/grid.go:246 +0x82a
main.main()
        /home/bradley/work/bcicen/ctop/main.go:111 +0x625
scott-scott commented 2 years ago

I have a similar experience with two of my containers while trying to view logs (by pressing L over the highlighted container). One is a basic nginx container, the other is an ASPNetCore application. Both result in the same message:

panic: runtime error: index out of range [1] with length 1

goroutine 112 [running]:
github.com/bcicen/ctop/connector/collector.(*DockerLogs).Stream.func1(0xc00012e080, 0xc00009c000, 0xc000420300)
        /home/bradley/work/bcicen/ctop/connector/collector/docker_logs.go:52 +0x1f4
created by github.com/bcicen/ctop/connector/collector.(*DockerLogs).Stream
        /home/bradley/work/bcicen/ctop/connector/collector/docker_logs.go:47 +0x278
bcicen commented 2 years ago

fixed in https://github.com/bcicen/ctop/commit/acbf17a4fd8bb08ef26cd8294c5dbeee1f548c8e; to be included in v0.7.8