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.35k stars 9.49k forks source link

Terraform crashed! #34039

Closed techieforfun closed 11 months ago

techieforfun commented 11 months ago

Terraform Version

`v1.6.0`, though I didn't get this on `v1.5.7`

Terraform Configuration Files

module "rds_mysql_sg" {
  source  = "../modules/aws/sg"

  name        = "rds-mysql"
  description = "Security group for RDS MySQL"
  vpc_id      = var.vpc_id

  ingress_with_cidr_blocks = var.ingress_with_cidr_blocks

  egress_with_cidr_blocks = var.egress_with_cidr_blocks

  tags = local.tags
}

Debug Output

Stack Trace:

value is marked, so must be unmarked first
goroutine 9191 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.21.1/x64/src/runtime/debug/stack.go:24 +0x5e
runtime/debug.PrintStack()
/opt/hostedtoolcache/go/1.21.1/x64/src/runtime/debug/stack.go:16 +0x13
github.com/hashicorp/terraform/internal/logging.PanicHandler()
/home/runner/work/terraform/terraform/internal/logging/panic.go:58 +0x13b
panic({0x2b92ec0?, 0x38c4c30?})
/opt/hostedtoolcache/go/1.21.1/x64/src/runtime/panic.go:920 +0x270
github.com/zclconf/go-cty/cty.Value.assertUnmarked(...)
/home/runner/go/pkg/mod/github.com/zclconf/go-cty@v1.14.0/cty/marks.go:141
github.com/zclconf/go-cty/cty.Value.AsString({{{0x3902720?, 0xc000012c29?}}, {0x2e1de40?, 0xc0034f4030?}})
/home/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({{{0x3902720?, 0xc000012c29?}}, {0x2e1de40?, 0xc0034f4030?}})
/home/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(0xc000250150, 0xc0034f4018)
/home/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(0xc0058b5b90, {0x3902df8?, 0xc000250150}, {{0x3902f48?, 0x5130520?}})
/home/runner/work/terraform/terraform/internal/lang/eval.go:175 +0x1bd
github.com/hashicorp/terraform/internal/terraform.(*nodeModuleVariable).evalModuleVariable(0xc0019b4de0, {0x391fb60?, 0xc0075150a0?}, 0x80?)
/home/runner/work/terraform/terraform/internal/terraform/node_module_variable.go:248 +0x225
github.com/hashicorp/terraform/internal/terraform.(*nodeModuleVariable).Execute(0xc0019b4de0, {0x391fb60, 0xc0075150a0}, 0x4)
/home/runner/work/terraform/terraform/internal/terraform/node_module_variable.go:183 +0x12c
github.com/hashicorp/terraform/internal/terraform.(*ContextGraphWalker).Execute(0xc006f5e120, {0x391fb60, 0xc0075150a0}, {0x7fd5684150e8, 0xc0019b4de0})
/home/runner/work/terraform/terraform/internal/terraform/graph_walk_context.go:143 +0xbe
github.com/hashicorp/terraform/internal/terraform.(*Graph).walk.func1({0x2f07ca0, 0xc0019b4de0})
/home/runner/work/terraform/terraform/internal/terraform/graph.go:78 +0x375
github.com/hashicorp/terraform/internal/dag.(*Walker).walkVertex(0xc0019b4f60, {0x2f07ca0, 0xc0019b4de0}, 0xc001aa1a40)
/home/runner/work/terraform/terraform/internal/dag/walk.go:384 +0x2e5
created by github.com/hashicorp/terraform/internal/dag.(*Walker).Update in goroutine 4170
/home/runner/work/terraform/terraform/internal/dag/walk.go:307 +0xde8
Operation failed: failed running terraform plan (exit 11)

Expected Behavior

Run plan successfully.

Actual Behavior

Got the crash error.

Steps to Reproduce

  1. terraform init
  2. terraform plan

Additional Context

No response

References

No response

apparentlymart commented 11 months ago

Thanks for reporting this, @techieforfun!

This seems to be the same problem as https://github.com/hashicorp/terraform/issues/33977, which already has a fix staged for inclusion in the forthcoming v1.6.1 release, and so I'm going to close this.

As you noticed, this is a new problem in v1.6.0 so I suggest remaining on the latest v1.5.x patch release for the moment and we'll be publishing v1.6.1 soon once a few other separate fixes are merged.

github-actions[bot] commented 9 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.