hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.71k stars 9.55k forks source link

TERRAFORM CRASH #34065

Closed ezarko closed 1 year ago

ezarko commented 1 year ago

Terraform Version

Terraform v1.6.0
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v5.20.1
+ provider registry.terraform.io/hashicorp/random v3.5.1

Terraform Configuration Files

Debug Output

value is marked, so must be unmarked first goroutine 6438 [running]: runtime/debug.Stack() /Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/debug/stack.go:24 +0x5e runtime/debug.PrintStack() /Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/debug/stack.go:16 +0x13 github.com/hashicorp/terraform/internal/logging.PanicHandler() /Users/runner/work/terraform/terraform/internal/logging/panic.go:58 +0x13b panic({0x379be40?, 0x44d1c70?}) /Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/panic.go:920 +0x270 github.com/zclconf/go-cty/cty.Value.assertUnmarked(...) /Users/runner/go/pkg/mod/github.com/zclconf/go-cty@v1.14.0/cty/marks.go:141 github.com/zclconf/go-cty/cty.Value.AsString({{{0x450fbe0?, 0xc00013cbd9?}}, {0x3a29120?, 0xc004c26df8?}}) /Users/runner/go/pkg/mod/github.com/zclconf/go-cty@v1.14.0/cty/value_ops.go:1385 +0x47 github.com/zclconf/go-cty/cty.Value.Range({{{0x450fbe0?, 0xc00013cbd9?}}, {0x3a29120?, 0xc004c26df8?}}) /Users/runner/go/pkg/mod/github.com/zclconf/go-cty@v1.14.0/cty/value_range.go:53 +0x285 github.com/hashicorp/hcl/v2/hclsyntax.(ConditionalExpr).Value(0xc000b9fa40, 0xc004c26de0) /Users/runner/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.18.0/hclsyntax/expression.go:746 +0xd6a github.com/hashicorp/terraform/internal/lang.(Scope).EvalExpr(0xc000fb8f30, {0x45102b8?, 0xc000b9fa40}, {{0x4510408?, 0x5d4a3c0?}}) /Users/runner/work/terraform/terraform/internal/lang/eval.go:175 +0x1bd github.com/hashicorp/terraform/internal/terraform.(nodeModuleVariable).evalModuleVariable(0xc0016e0f60, {0x452d0a0?, 0xc00329cfc0?}, 0x80?) /Users/runner/work/terraform/terraform/internal/terraform/node_module_variable.go:248 +0x225 github.com/hashicorp/terraform/internal/terraform.(nodeModuleVariable).Execute(0xc0016e0f60, {0x452d0a0, 0xc00329cfc0}, 0x4) /Users/runner/work/terraform/terraform/internal/terraform/node_module_variable.go:183 +0x12c github.com/hashicorp/terraform/internal/terraform.(ContextGraphWalker).Execute(0xc0064b0000, {0x452d0a0, 0xc00329cfc0}, {0x4eb43fd0, 0xc0016e0f60}) /Users/runner/work/terraform/terraform/internal/terraform/graph_walk_context.go:143 +0xbe github.com/hashicorp/terraform/internal/terraform.(Graph).walk.func1({0x3b141e0, 0xc0016e0f60}) /Users/runner/work/terraform/terraform/internal/terraform/graph.go:78 +0x375 github.com/hashicorp/terraform/internal/dag.(Walker).walkVertex(0xc0016e1020, {0x3b141e0, 0xc0016e0f60}, 0xc003f13e80) /Users/runner/work/terraform/terraform/internal/dag/walk.go:384 +0x2e5 created by github.com/hashicorp/terraform/internal/dag.(Walker).Update in goroutine 2753 /Users/runner/work/terraform/terraform/internal/dag/walk.go:307 +0xde8

Expected Behavior

terraform plan completes successfully

Actual Behavior

TERRAFORM CRASH

Steps to Reproduce

  1. terraform init
  2. terraform plan

Additional Context

running a modified version of https://github.com/terraform-aws-modules/terraform-aws-rds/blob/v6.1.1/examples/complete-postgres/main.tf

References

No response

ezarko commented 1 year ago

I confirmed that it works on an unmodified version as well.

git clone git@github.com:terraform-aws-modules/terraform-aws-rds.git
cd terraform-aws-rds/examples/complete-postgres
terraform init
terraform plan
jbardin commented 1 year ago

Duplicate of #33977

github-actions[bot] commented 11 months ago

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.