tarantool / tt

Command-line utility to manage Tarantool applications
Other
101 stars 12 forks source link

Bug: tt connect autocompletion crashes #944

Closed ochaton closed 4 weeks ago

ochaton commented 1 month ago

Just do:

tt connect test-vshard:storage_001_01

type box and tab-tab-tab and so on

test-vshard:storage_001_01> box.2024/09/13 15:46:56 whoops! It looks like something is wrong with this version of Tarantool CLI.
Error: Unhandled internal error: runtime error: index out of range [37] with length 0
Version: Tarantool CLI version 2.4.0, darwin/arm64. commit: 060408f
Stacktrace:
goroutine 1 [running]:
runtime/debug.Stack()
        /opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/debug/stack.go:24 +0x64
github.com/tarantool/tt/cli/util.InternalError({0x100c93c51, 0x1c}, 0x1400004ce90?, {0x1400004ce48, 0x1, 0x1})
        cli/util/util.go:137 +0x70
main.main.func1()
        cli/main.go:18 +0x58
panic({0x1010b2720?, 0x140008085d0?})
        /opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/panic.go:770 +0x124
github.com/tarantool/go-prompt.(*CompletionManager).GetSelectedSuggestion(0x140004c2320?)
        /Users/ochaton/go/pkg/mod/github.com/tarantool/go-prompt@v1.0.0/completion.go:51 +0xd0
github.com/tarantool/go-prompt.(*Render).Render(0x140004c2320, {0x14000414dc0, {0x0, 0x27}, {0x0, 0x20}, 0x140000aa870, 0xd, {0x140002f8760, 0x1c}, ...})
        /Users/ochaton/go/pkg/mod/github.com/tarantool/go-prompt@v1.0.0/render.go:248 +0x158
github.com/tarantool/go-prompt.(*Prompt).render(0x140004c0f00, 0x140006af000?)
        /Users/ochaton/go/pkg/mod/github.com/tarantool/go-prompt@v1.0.0/prompt.go:448 +0xd8
github.com/tarantool/go-prompt.(*Prompt).Run(0x140004c0f00)
        /Users/ochaton/go/pkg/mod/github.com/tarantool/go-prompt@v1.0.0/prompt.go:169 +0x68c
github.com/tarantool/tt/cli/connect.(*Console).Run(0x14000390140)
        cli/connect/console.go:167 +0x194
github.com/tarantool/tt/cli/connect.runConsole({{0x100c74787, 0x4}, {0x14000040480, 0x59}, {0x0, 0x0}, {0x0, 0x0}, {{_, _}, ...}}, ...)
        cli/connect/connect.go:142 +0x14c
github.com/tarantool/tt/cli/connect.Connect({{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, 0x0, {0x0, 0x0}, ...}, ...)
        cli/connect/connect.go:80 +0xb4
github.com/tarantool/tt/cli/cmd.internalConnectModule(0x1018712e0, {0x1400013c080, 0x1, 0x1})
        cli/cmd/connect.go:233 +0x3c4
github.com/tarantool/tt/cli/modules.RunCmd(0x1018712e0, {0x14000120b60, 0xa}, 0xb16fe1f000000000?, 0x10112dc88, {0x1400013c080, 0x1, 0x1})
        cli/modules/run.go:36 +0x8c
github.com/tarantool/tt/cli/cmd.NewConnectCmd.func1(0x140004a0308, {0x1400013c080, 0x1, 0x1})
        cli/cmd/connect.go:65 +0x94
github.com/spf13/cobra.(*Command).execute(0x140004a0308, {0x14000032410, 0x1, 0x1})
        /Users/ochaton/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0x828
github.com/spf13/cobra.(*Command).ExecuteC(0x140003c8608)
        /Users/ochaton/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/ochaton/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/tarantool/tt/cli/cmd.Execute()
        cli/cmd/root.go:212 +0x24
main.main()
        cli/main.go:23 +0x3c
oleg-jukovec commented 1 month ago

Thank you, what version of Tarantool?

ochaton commented 1 month ago

Tarantool 3.3.0-entrypoint-7

dmyger commented 1 month ago

@ochaton could you try to reproduce the issue with tt from PR https://github.com/tarantool/tt/pull/959

oleg-jukovec commented 1 month ago

How to reproduce:

  1. Connect to a tarantool.
  2. Input box. in tt and press tab.
  3. Kill the tarantool.
  4. Press tab.