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 crash - value is marked, so must be unmarked first #34051

Closed NeorisCamilo closed 11 months ago

NeorisCamilo commented 11 months ago

Terraform Version

Terraform v1.6.0
on linux_amd64
+ provider registry.terraform.io/gavinbunney/kubectl v1.14.0
+ provider registry.terraform.io/hashicorp/aws v5.20.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.3.2
+ provider registry.terraform.io/hashicorp/helm v2.11.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.23.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
+ provider registry.terraform.io/hashicorp/time v0.9.1
+ provider registry.terraform.io/hashicorp/tls v4.0.4

Terraform Configuration Files

terraform {
  required_version = ">= 1.0.0"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 5.0"
    }
    kubernetes = {
      source  = "hashicorp/kubernetes"
      version = ">= 2.20.0"
    }
    helm = {
      source  = "hashicorp/helm"
      version = ">= 2.9.0"
    }
    kubectl = {
      source  = "gavinbunney/kubectl"
      version = ">= 1.14"
    }
    random = {
      source  = "hashicorp/random"
      version = "3.5.1"
    }
  }
}

Debug Output

.

Expected Behavior

Terraform was working fine, a day later without any changes applied it started to crash

Actual Behavior

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!! Terraform crashed! This is always indicative of a bug within Terraform. Please report the crash with Terraform1 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.

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!! value is marked, so must be unmarked first goroutine 20835 [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?, 0xc00013abe1?}}, {0x2e1de40?, 0xc007037950?}}) /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?, 0xc00013abe1?}}, {0x2e1de40?, 0xc007037950?}}) /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(0xc0000c32d0, 0xc007037938) /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(0xc002ab2ea0, {0x3902df8?, 0xc0000c32d0}, {{0x3902f48?, 0x5130520?}}) /home/runner/work/terraform/terraform/internal/lang/eval.go:175 +0x1bd github.com/hashicorp/terraform/internal/terraform.(BuiltinEvalContext).EvaluateExpr(0x4f?, {0x3902df8, 0xc0000c32d0}, {{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(0x7f984d3a2880?, {0x391fb60, 0xc005587420}, 0x10?) /home/runner/work/terraform/terraform/internal/terraform/node_local.go:158 +0x592 github.com/hashicorp/terraform/internal/terraform.(ContextGraphWalker).Execute(0xc006436000, {0x391fb60, 0xc005587420}, {0x7f984d63f760, 0xc00e3f2a20}) /home/runner/work/terraform/terraform/internal/terraform/graph_walk_context.go:143 +0xbe github.com/hashicorp/terraform/internal/terraform.(Graph).walk.func1({0x2f593a0, 0xc00e3f2a20}) /home/runner/work/terraform/terraform/internal/terraform/graph.go:78 +0x375 github.com/hashicorp/terraform/internal/dag.(Walker).walkVertex(0xc00e3d8fc0, {0x2f593a0, 0xc00e3f2a20}, 0xc00e3fc200) /home/runner/work/terraform/terraform/internal/dag/walk.go:384 +0x2e5 created by github.com/hashicorp/terraform/internal/dag.(Walker).Update in goroutine 5569 /home/runner/work/terraform/terraform/internal/dag/walk.go:307 +0xde8 FAILED: Terraform apply of module.vpc failed

Steps to Reproduce

  1. terraform init
  2. terraform apply -target="module.vpc"

Additional Context

Only AWS resources were deployed, Terraform was actually working well, but the next day without any changes it started to fail

References

No response

jbardin commented 11 months ago

Duplicate of #33977

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.