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

Crash report: CLI autocomplete #31126

Closed
JosephKelly opened this issue May 25, 2022 · 4 comments · Fixed by #31160
Closed

Crash report: CLI autocomplete #31126

JosephKelly opened this issue May 25, 2022 · 4 comments · Fixed by #31160
Assignees
Labels
bug cli confirmed a Terraform Core team member has reproduced this issue explained a Terraform Core team member has described the root cause of this issue in code

Comments

@JosephKelly
Copy link

JosephKelly commented May 25, 2022

Hi there,

  • Opened a shell and typed terraform state (with or without a trailing space). Pressing the tab key (->|) causes a crash:

Terraform Version

$ tf -version
Terraform v1.2.1
on linux_amd64

Running from a bash shell on Linux Mint 20.2

$ bash -version
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)

Stack trace

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

runtime error: index out of range [0] with length 0
goroutine 1 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x19
github.com/hashicorp/terraform/internal/logging.PanicHandler()
        /home/circleci/project/project/internal/logging/panic.go:55 +0x153
panic({0x251f100, 0xc000724360})
        /usr/local/go/src/runtime/panic.go:844 +0x258
github.com/mitchellh/cli.(*CLI).processArgs(0xc000a16640)
        /home/circleci/go/pkg/mod/github.com/mitchellh/cli@v1.1.3/cli.go:688 +0x9ec
github.com/mitchellh/cli.(*CLI).init(0xc000a16640)
        /home/circleci/go/pkg/mod/github.com/mitchellh/cli@v1.1.3/cli.go:392 +0x3e9
sync.(*Once).doSlow(0xc00005c004?, 0x4d?)
        /usr/local/go/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
        /usr/local/go/src/sync/once.go:59
github.com/mitchellh/cli.(*CLI).Subcommand(...)
        /home/circleci/go/pkg/mod/github.com/mitchellh/cli@v1.1.3/cli.go:276
main.realMain()
        /home/circleci/project/project/main.go:240 +0xfb5
main.main()
        /home/circleci/project/project/main.go:58 +0x19

@JosephKelly JosephKelly added bug new new issue not yet triaged labels May 25, 2022
@kmoe kmoe added cli and removed new new issue not yet triaged labels May 26, 2022
@kmoe kmoe self-assigned this May 26, 2022
@crw
Copy link
Contributor

crw commented May 28, 2022

Thanks for the report!

@kmoe
Copy link
Member

kmoe commented May 30, 2022

Confirmed that this happens in Ubuntu 22.04 (Docker container) with Terraform v1.2.1 installed via apt.

Curiously this does not happen on my main Arch Linux machine.

This is in any case fixed by mitchellh/cli#94. When a new version of mitchellh/cli is tagged, I'll bump the dependency in Terraform.

@kmoe kmoe added confirmed a Terraform Core team member has reproduced this issue explained a Terraform Core team member has described the root cause of this issue in code labels May 30, 2022
@jfouquat
Copy link

Confirmed that this happens in Ubuntu 22.04 (Docker container) with Terraform v1.2.1 installed via apt.

Curiously this does not happen on my main Arch Linux machine.

This is in any case fixed by mitchellh/cli#94. When a new version of mitchellh/cli is tagged, I'll bump the dependency in Terraform.

Thank you for your help and sorry about duplicate ticket I've created (#31155) @kmoe . Regards, J.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug cli confirmed a Terraform Core team member has reproduced this issue explained a Terraform Core team member has described the root cause of this issue in code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants