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

slice bounds out of range when attempting to list consumers in a jetstream cluster #933

Open
TomHellier opened this issue Dec 11, 2023 · 2 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@TomHellier
Copy link

TomHellier commented Dec 11, 2023

Observed behavior

I'm attempting to list the consumers in a jetstream cluster using exec via:

  • the kubernetes dashboard.
  • argocd terminal interface

This works if I use kubectl, but I don't readily have access to that in all of the environments I deploy to.

~ # nats consumer ls
panic: runtime error: slice bounds out of range [:-2]

goroutine 1 [running]:
github.com/AlecAivazis/survey/v2.paginate(0x1a948e0?, {0xc0004c9320?, 0xc000465358?, 0xc000465388?}, 0x1005540?)
        /go/amd64/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.7/survey.go:435 +0xad
github.com/AlecAivazis/survey/v2.(*Select).Prompt(0xc000414240, 0xc000192468)
        /go/amd64/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.7/select.go:259 +0x3e5
github.com/AlecAivazis/survey/v2.Ask({0xc0004657f8, 0x1, 0xc000465808?}, {0xf431e0?, 0xc0004c56d0}, {0xc0004657f0, 0x1, 0x10ac6a0?})
        /go/amd64/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.7/survey.go:366 +0x36f
github.com/AlecAivazis/survey/v2.AskOne(...)
        /go/amd64/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.7/survey.go:283
github.com/nats-io/natscli/cli.askOne({0x13555e8, 0xc000414240}, {0xf431e0, 0xc0004c56d0}, {0x0, 0x0, 0x0?})
        /go/amd64/pkg/mod/github.com/nats-io/natscli@v0.1.1/cli/util.go:161 +0x193
github.com/nats-io/natscli/cli.selectStream(0x0?, {0x0, 0x0}, 0x0, 0x0)
        /go/amd64/pkg/mod/github.com/nats-io/natscli@v0.1.1/cli/util.go:143 +0x3f6
github.com/nats-io/natscli/cli.(*consumerCmd).connectAndSetup(0xc0001a7340, 0x1, 0x0, {0x0, 0x0, 0x0?})
        /go/amd64/pkg/mod/github.com/nats-io/natscli@v0.1.1/cli/consumer_command.go:1631 +0x1b6
github.com/nats-io/natscli/cli.(*consumerCmd).lsAction(0xc0001a7340, 0x0?)
        /go/amd64/pkg/mod/github.com/nats-io/natscli@v0.1.1/cli/consumer_command.go:491 +0x35
github.com/choria-io/fisk.(*actionMixin).applyActions(...)
        /go/amd64/pkg/mod/github.com/choria-io/fisk@v0.6.0/actions.go:28
github.com/choria-io/fisk.(*Application).applyActions(0xc0003c8f00?, 0xc00039e000)
        /go/amd64/pkg/mod/github.com/choria-io/fisk@v0.6.0/app.go:815 +0xdf
github.com/choria-io/fisk.(*Application).execute(0xc0003c8f00, 0xc00039e000?, {0xc0004a9100, 0x2, 0x2})
        /go/amd64/pkg/mod/github.com/choria-io/fisk@v0.6.0/app.go:609 +0x65
github.com/choria-io/fisk.(*Application).Parse(0xc0003c8f00, {0xc0001161c0?, 0xc0004c29b8?, 0xc0004c2a18?})
        /go/amd64/pkg/mod/github.com/choria-io/fisk@v0.6.0/app.go:272 +0x16c
github.com/choria-io/fisk.(*Application).MustParseWithUsage(0xc0003c8f00, {0xc0001161c0, 0x2, 0x2})
        /go/amd64/pkg/mod/github.com/choria-io/fisk@v0.6.0/app.go:881 +0x45
main.main()
        /go/amd64/pkg/mod/github.com/nats-io/natscli@v0.1.1/nats/main.go:74 +0x2a38

Expected behavior

Lists the consumers running in the jetstream cluster

Server and client version

cli v0.1.1
server
2.10.1-alpine

Host environment

kubernetes 1.27

Steps to reproduce

Attempt to use CLI in a terminal interface provided by common kubernetes tooling.

Related to #604

@TomHellier TomHellier added the defect Suspected defect such as a bug or regression label Dec 11, 2023
@TomHellier
Copy link
Author

It also looks like github.com/AlecAivazis/survey is out of life, so probably worth transitioning to an alternative

@ripienaar
Copy link
Collaborator

Yeah, its a bit sad - and the alternatives are not great from a dependencies perspective

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

2 participants