Skip to content

terraform show crashes when AWS_PROFILE env is missing #31127

@sateeshblue

Description

@sateeshblue

Terraform Version

Terraform v1.2.1
on linux_amd64
+ provider registry.terraform.io/cloudposse/awsutils v0.11.0
+ provider registry.terraform.io/hashicorp/aws v4.11.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/random v3.1.3
+ provider registry.terraform.io/hashicorp/tls v3.3.0

Terraform Configuration Files

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

Terraform crashed! This is always indicative of a bug within Terraform.
Please report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version, the stack trace
shown below, and any additional information which may help replicate the issue.

[1]: https://github.com/hashicorp/terraform/issues

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

can't construct diagnostic(s) from string
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({0x22b6a40, 0xc000d437c0})
        /usr/local/go/src/runtime/panic.go:844 +0x258
github.com/hashicorp/terraform/internal/tfdiags.Diagnostics.Append({0x0?, 0xb8?, 0x26b428d?}, {0xc000c1f7f0?, 0x1, 0x3e8a710?})
        /home/circleci/project/project/internal/tfdiags/diagnostics.go:86 +0xa0e
github.com/hashicorp/terraform/internal/command.(*ShowCommand).showFromLatestStateSnapshot(0xc000188000)
        /home/circleci/project/project/internal/command/show.go:154 +0x245
github.com/hashicorp/terraform/internal/command.(*ShowCommand).show(0xc000188000, {0x0, 0x0})
        /home/circleci/project/project/internal/command/show.go:93 +0x6d
github.com/hashicorp/terraform/internal/command.(*ShowCommand).Run(0xc000188000, {0xc00004c050?, 0xffffffffffffffff?, 0x0?})
        /home/circleci/project/project/internal/command/show.go:51 +0x218
github.com/mitchellh/cli.(*CLI).Run(0xc0002c6500)
        /home/circleci/go/pkg/mod/github.com/mitchellh/cli@v1.1.3/cli.go:262 +0x5f8
main.realMain()
        /home/circleci/project/project/main.go:312 +0x15b4
main.main()
        /home/circleci/project/project/main.go:58 +0x19

Debug Output

Expected Behavior

terraform listing

Actual Behavior

Steps to Reproduce

terraform show

Additional Context

exporting the AWS_PROFILE fixes the issue

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcliconfirmeda Terraform Core team member has reproduced this issuecrash

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions