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

aqua g raises a panic #801

Closed
suzuki-shunsuke opened this issue May 28, 2022 · 2 comments · Fixed by #802
Closed

aqua g raises a panic #801

suzuki-shunsuke opened this issue May 28, 2022 · 2 comments · Fixed by #802
Labels
bug Something isn't working
Milestone

Comments

@suzuki-shunsuke
Copy link
Member

aqua version

Please use the latest version.

$ aqua -v
aqua version 1.6.2 (f23bd7fe5dc398132a11ffa25356b8e535d3a7f6)

Environment

⚠️ aqua doesn't support Windows.

  • OS (Linux, macOS, etc): macOS
  • CPU Architecture (amd64, arm64, etc): amd64

Overview

How to reproduce

  • aqua.yaml
  • executed command and output

aqua.yaml should be not partial but complete configuration.
Please remove unneeded configuration to reproduce the issue.

# aqua.yaml
$ aqua g

When you input tfplu, panic occurs.

  bufbuild/buf (standard) (buf, protoc-gen-buf-breaking, protoc-gen-buf-lint)            │                                                                                        
> pivotal-cf/pivnet-cli (standard) (pivnet)                                              │                                                                                        
  2/500                                                                                  │                                                                                        
> tfplpanic: runtime error: index out of range [-1]                                      └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─  

                                                   goroutine 23 [running]:
                                                                          github.com/aquaproj/aqua/pkg/controller/generate.(*fuzzyFinder).Find.func2(0x0?, 0x0?, 0x0?)
                                                                                                                                                                      	/home/runner/work/aqua/aqua/pkg/controller/generate/finder.go:41 +0x46
                                                            github.com/ktr0731/go-fuzzyfinder.(*finder)._drawPreview(0xc0002e7040)
                                                                                                                                  	/home/runner/go/pkg/mod/github.com/ktr0731/go-fuzzyfinder@v0.6.0/fuzzyfinder.go:279 +0xbd
                                               github.com/ktr0731/go-fuzzyfinder.(*finder).initFinder.func1()
                                                                                                             	/home/runner/go/pkg/mod/github.com/ktr0731/go-fuzzyfinder@v0.6.0/fuzzyfinder.go:105 +0x45
                       created by time.goFunc
                                             	/opt/hostedtoolcache/go/1.18.1/x64/src/time/sleep.go:176 +0x32

                                                                                                              ~ 12s
❯ 

Debug Output

Please set the environment variable AQUA_LOG_LEVEL=debug and run aqua and tell us the debug output.

$ 

Expected Behaviour

You can search packages without panic.

Actual Behaviour

Panic occurs.

Important Factoids

References

@suzuki-shunsuke suzuki-shunsuke added the bug Something isn't working label May 28, 2022
@suzuki-shunsuke
Copy link
Member Author

return getPreview(pkgs[i], i, w)

panic: runtime error: index out of range [-1]

@suzuki-shunsuke
Copy link
Member Author

https://pkg.go.dev/github.com/ktr0731/go-fuzzyfinder#WithPreviewWindow

If there is no selected item, previewFunc passes -1 to previewFunc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant