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 - version 1.6.0 on plan & validate steps #34044

Closed dariuswatson closed 1 year ago

dariuswatson commented 1 year ago

Terraform Version

Terraform v1.6.0
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v4.39.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.15.0
+ provider registry.terraform.io/hashicorp/local v2.2.3
+ provider registry.terraform.io/hashicorp/random v3.4.3
+ provider registry.terraform.io/hashicorp/tls v4.0.4

Terraform Configuration Files

...terraform config...

Debug Output

% terraform plan
Running plan in the remote backend. Output will stream here. Pressing Ctrl-C
will stop streaming the logs, but will not stop the plan running remotely.

Preparing the remote plan...

To view this run in a browser, visit:
https://app.terraform.io/app/ourtilt/tilt-dev/runs/run-DGXgx1ek222rfSNv

Waiting for the plan to start...

Terraform v1.6.0
on linux_amd64
Initializing plugins and modules...

!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!

value is marked, so must be unmarked first
goroutine 4569 [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?, 0xc000012c49?}}, {0x2e1de40?, 0xc005e3cb58?}})
    /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?, 0xc000012c49?}}, {0x2e1de40?, 0xc005e3cb58?}})
    /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(0xc00062c230, 0xc005e3cb40)
    /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(0xc001096870, {0x3902df8?, 0xc00062c230}, {{0x3902f48?, 0x5130520?}})
    /home/runner/work/terraform/terraform/internal/lang/eval.go:175 +0x1bd
github.com/hashicorp/terraform/internal/terraform.(*BuiltinEvalContext).EvaluateExpr(0x0?, {0x3902df8, 0xc00062c230}, {{0x3902f48?, 0x5130520?}}, {0x0?, 0x0?})
    /home/runner/work/terraform/terraform/internal/terraform/eval_context_builtin.go:289 +0xab
github.com/hashicorp/terraform/internal/terraform.(*NodeLocal).Execute(0x7fccd7f6a578?, {0x391fb60, 0xc001a9bdc0}, 0x20?)
    /home/runner/work/terraform/terraform/internal/terraform/node_local.go:158 +0x592
github.com/hashicorp/terraform/internal/terraform.(*ContextGraphWalker).Execute(0xc0027a37a0, {0x391fb60, 0xc001a9bdc0}, {0x7fccd7cc5180, 0xc003ac2900})
    /home/runner/work/terraform/terraform/internal/terraform/graph_walk_context.go:143 +0xbe
github.com/hashicorp/terraform/internal/terraform.(*Graph).walk.func1({0x2f593a0, 0xc003ac2900})
    /home/runner/work/terraform/terraform/internal/terraform/graph.go:78 +0x375
github.com/hashicorp/terraform/internal/dag.(*Walker).walkVertex(0xc000f7c180, {0x2f593a0, 0xc003ac2900}, 0xc0058b0b40)
    /home/runner/work/terraform/terraform/internal/dag/walk.go:384 +0x2e5
created by github.com/hashicorp/terraform/internal/dag.(*Walker).Update in goroutine 2137
    /home/runner/work/terraform/terraform/internal/dag/walk.go:307 +0xde8
Operation failed: failed running terraform plan (exit 11)
% terraform validate

!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!

value is marked, so must be unmarked first
goroutine 4628 [running]:
runtime/debug.Stack()
    /Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
    /Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/debug/stack.go:16 +0x1c
github.com/hashicorp/terraform/internal/logging.PanicHandler()
    /Users/runner/work/terraform/terraform/internal/logging/panic.go:58 +0x164
panic({0x1051ca8a0?, 0x1057ba060?})
    /Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/panic.go:920 +0x26c
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({{{0x1057f7b88?, 0x14000010c69?}}, {0x1054579a0?, 0x14001537fc8?}})
    /Users/runner/go/pkg/mod/github.com/zclconf/go-cty@v1.14.0/cty/value_ops.go:1385 +0x54
github.com/zclconf/go-cty/cty.Value.Range({{{0x1057f7b88?, 0x14000010c69?}}, {0x1054579a0?, 0x14001537fc8?}})
    /Users/runner/go/pkg/mod/github.com/zclconf/go-cty@v1.14.0/cty/value_range.go:53 +0x25c
github.com/hashicorp/hcl/v2/hclsyntax.(*ConditionalExpr).Value(0x14000a28380, 0x14001537fb0)
    /Users/runner/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.18.0/hclsyntax/expression.go:746 +0x9dc
github.com/hashicorp/terraform/internal/lang.(*Scope).EvalExpr(0x1400095b5f0, {0x1057f8258?, 0x14000a28380}, {{0x1057f83a8?, 0x106fb4580?}})
    /Users/runner/work/terraform/terraform/internal/lang/eval.go:175 +0x17c
github.com/hashicorp/terraform/internal/terraform.(*BuiltinEvalContext).EvaluateExpr(0x14004d5a758?, {0x1057f8258, 0x14000a28380}, {{0x1057f83a8?, 0x106fb4580?}}, {0x0?, 0x0?})
    /Users/runner/work/terraform/terraform/internal/terraform/eval_context_builtin.go:289 +0x84
github.com/hashicorp/terraform/internal/terraform.(*NodeLocal).Execute(0x12ec17380?, {0x105812450, 0x140053127e0}, 0x0?)
    /Users/runner/work/terraform/terraform/internal/terraform/node_local.go:158 +0x440
github.com/hashicorp/terraform/internal/terraform.(*ContextGraphWalker).Execute(0x14001349560, {0x105812450, 0x140053127e0}, {0x12e731210, 0x140032a5f20})
    /Users/runner/work/terraform/terraform/internal/terraform/graph_walk_context.go:143 +0xa0
github.com/hashicorp/terraform/internal/terraform.(*Graph).walk.func1({0x1055940a0, 0x140032a5f20})
    /Users/runner/work/terraform/terraform/internal/terraform/graph.go:78 +0x280
github.com/hashicorp/terraform/internal/dag.(*Walker).walkVertex(0x140027dcae0, {0x1055940a0, 0x140032a5f20}, 0x14000f76280)
    /Users/runner/work/terraform/terraform/internal/dag/walk.go:384 +0x2a8
created by github.com/hashicorp/terraform/internal/dag.(*Walker).Update in goroutine 1887
    /Users/runner/work/terraform/terraform/internal/dag/walk.go:307 +0xb0c

Expected Behavior

Successfully run terraform plan and terraform validate

Actual Behavior

Using Terraform Cloud, upgraded workspace & version.tf to 1.6.0 and get "TERRAFORM CRASH" message when running plan and validate

Steps to Reproduce

terraform init --upgrad terraform plan

Additional Context

References

Issue 34040

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.