synadia-io / nex

The NATS execution engine
https://docs.nats.io/using-nats/nex
Apache License 2.0
205 stars 17 forks source link

darwin crash on first startup of nex. #361

Open gedw99 opened 3 months ago

gedw99 commented 3 months ago

Observed behavior


./nex_0.3.0-rc1_darwin_arm64 tui
================================================================
🎉 There is a newer version [v0.2.7] of the NEX CLI available 🎉
To update, run:
     nex upgrade
================================================================

Caught panic:

interface conversion: list.Item is nil, not home.nexNode

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
    runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
    runtime/debug/stack.go:16 +0x1c
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
    github.com/charmbracelet/bubbletea@v0.26.6/tea.go:479 +0x88
panic({0x103976900?, 0x14000482390?})
    runtime/panic.go:770 +0x124
github.com/synadia-io/nex/nex/tui/home.HomeModel.Update({0xbe, 0x3a, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...}, ...)
    github.com/synadia-io/nex/nex/tui/home/model.go:147 +0xd14
github.com/synadia-io/nex/nex/tui.model.Update({0xbe, 0x3a, {0x0, 0x0}, 0x0, 0x0, {0x103b12a50, 0x14000394000}, {0x0, 0x0}, ...}, ...)
    github.com/synadia-io/nex/nex/tui/update.go:41 +0x8d0
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0x14000267700, {0x103b12a80?, 0x140002e2380?}, 0x14000027320)
    github.com/charmbracelet/bubbletea@v0.26.6/tea.go:412 +0x59c
github.com/charmbracelet/bubbletea.(*Program).Run(0x14000267700)
    github.com/charmbracelet/bubbletea@v0.26.6/tea.go:550 +0x7ec
github.com/synadia-io/nex/nex/tui.StartTUI({0x0, 0x0})
    github.com/synadia-io/nex/nex/tui/tui.go:16 +0x12c
main.main()
    github.com/synadia-io/nex/nex/nex.go:265 +0x2184
apple@192 Downloads % ./nex_0.3.0-rc1_darwin_arm64 tui

Expected behavior

not panic on fresh install on new machine, when I open the tui.

The 2nd time you open it is does not panic, if I recall.. So you might not get this bug unless you do it on a clean machine.

Nex and NATS version

https://github.com/synadia-io/nex/releases/tag/0.3.0-rc1

Downloads % ./nex_0.3.0-rc1_darwin_arm64 --version

🎉 There is a newer version [v0.2.7] of the NEX CLI available 🎉 To update, run: nex upgrade

v0.3.0-rc1 [c5899ff211885083242830c27ffd089ef121feed] | Built-on: 2024-08-16T00:22:43Z

Host environment

Mac m2

Steps to reproduce

download the tagged version off github and then:

xattr -dr com.apple.quarantine ./nex_0.3.0-rc1_darwin_arm64
chmod +x ./nex_0.3.0-rc1_darwin_arm64
jordan-rash commented 3 months ago

As noted in the README (and I believe the --help as well), the tui is very experimental right now and I would expect it to break randomly.

Try running any other command and let me know if it breaks for you

If that feature isn't ready by the time we stop cutting RC tags, then it will be placed behind a build tag as to not clutter the DX

autodidaddict commented 3 months ago

Yep as Jordan notes, tui is experimental and may end up moving to an entirely different place