Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Investigate npe in stream selection #604

Closed
ripienaar opened this issue Oct 18, 2022 · 1 comment
Closed

Investigate npe in stream selection #604

ripienaar opened this issue Oct 18, 2022 · 1 comment

Comments

@ripienaar
Copy link
Collaborator

As reported in nats-io/nats-server#3554

~ # nats s info --trace
14:22:35 >>> $JS.API.STREAM.NAMES
{"offset":0}

14:22:35 <<< $JS.API.STREAM.NAMES
{"type":"io.nats.jetstream.api.v1.stream_names_response","total":17,"offset":0,"limit":1024,"streams":["test2-1-1","test2-1-2","test2-1-3","test2-1-4","test2-2-1","test2-2-2","test2-2-3","test2-2-4","test-error","test3-1","test3-2","test3-3","test3-4","test1-1","test1-2","test1-3","test1-4"]}

panic: runtime error: slice bounds out of range [:-2]

goroutine 1 [running]:
github.com/AlecAivazis/survey/v2.paginate(0xe57b80?, {0xc0006b2300?, 0x14?, 0x194?}, 0xc00011f200?)
        /go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/survey.go:403 +0xae
github.com/AlecAivazis/survey/v2.(*Select).Prompt(0xc00019f680, 0xc0004c69e8)
        /go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/select.go:259 +0x18c
github.com/AlecAivazis/survey/v2.Ask({0xc0004c3980, 0x1, 0x7f8d4e580dd8?}, {0xdd00c0?, 0xc0002819e0}, {0x0, 0x0, 0xc00019f680?})
        /go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/survey.go:334 +0x38c
github.com/AlecAivazis/survey/v2.AskOne(...)
        /go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/survey.go:251
github.com/nats-io/natscli/cli.askOne({0x11566d0, 0xc00019f680}, {0xdd00c0, 0xc0002819e0}, {0x0, 0x0, 0x0})
        /go/pkg/mod/github.com/nats-io/natscli@v0.0.34/cli/util.go:187 +0xd6
github.com/nats-io/natscli/cli.selectStream(0x0?, {0x0, 0x0}, 0x0, 0x0)
        /go/pkg/mod/github.com/nats-io/natscli@v0.0.34/cli/util.go:169 +0x1c5
github.com/nats-io/natscli/cli.(*streamCmd).connectAndAskStream(0xc0006b2000)
        /go/pkg/mod/github.com/nats-io/natscli@v0.0.34/cli/stream_command.go:2625 +0xc9
github.com/nats-io/natscli/cli.(*streamCmd).infoAction(0xc0006b2000, 0x0?)
        /go/pkg/mod/github.com/nats-io/natscli@v0.0.34/cli/stream_command.go:1844 +0x25
github.com/choria-io/fisk.(*actionMixin).applyActions(0xc000121248?, 0xf01220?)
        /go/pkg/mod/github.com/choria-io/fisk@v0.2.1/actions.go:28 +0x5c
github.com/choria-io/fisk.(*Application).applyActions(0xc00015a640?, 0xc000132000)
        /go/pkg/mod/github.com/choria-io/fisk@v0.2.1/app.go:761 +0xed
github.com/choria-io/fisk.(*Application).execute(0xc00015a640, 0xc000132000?, {0xc000089520, 0x2, 0x2})
        /go/pkg/mod/github.com/choria-io/fisk@v0.2.1/app.go:599 +0x66
github.com/choria-io/fisk.(*Application).Parse(0xc00015a640, {0xc000032090?, 0x7f8d4e5775b8?, 0xd0?})
        /go/pkg/mod/github.com/choria-io/fisk@v0.2.1/app.go:262 +0x14f
github.com/choria-io/fisk.(*Application).MustParseWithUsage(0xc00015a640, {0xc000032090, 0x3, 0x3})
        /go/pkg/mod/github.com/choria-io/fisk@v0.2.1/app.go:827 +0x4e
main.main()
        /go/pkg/mod/github.com/nats-io/natscli@v0.0.34/nats/main.go:69 +0x20ce
~ # 
@ripienaar
Copy link
Collaborator Author

This is a bug in the survey library that is caused by not being able to figure out the screen size, but I havnt been able to reproduce and we've not had more reports of this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant