Loading...
Loading...
### Terraform Version ```shell Run hashicorp/setup-terraform@v3 with: cli_config_credentials_token: *** cli_config_credentials_hostname: app.terraform.io terraform_version: latest terraform_wrapper: true At this moment latest version is v1.10.0 ``` ### Terraform Configuration Files ```terraform ...terraform config... ``` ### Debug Output Call to function "templatefile" failed: panic in function implementation: value is not known goroutine 1370 [running]: runtime/debug.Stack() runtime/debug/stack.go:26 +0x5e github.com/zclconf/go-cty/cty/function.errorForPanic(...) github.com/zclconf/go-cty@v1.15.1-0.20241111215639-63279be090d7/cty/function/error.go:44 github.com/zclconf/go-cty/cty/function.Function.Call.func2() github.com/zclconf/go-cty@v1.15.1-0.20241111215639-63279be090d7/cty/function/function.go:349 +0x9b panic({0x3050be0?, 0x3ddad80?}) runtime/panic.go:785 +0x132 github.com/zclconf/go-cty/cty.Value.LengthInt({{{0x3e20ec8?, 0xc000515ef0?}}, {0x315d760?, 0x5a112e0?}}) github.com/zclconf/go-cty@v1.15.1-0.20241111215639-63279be090d7/cty/value_ops.go:1135 +0x26b github.com/zclconf/go-cty/cty.Value.AsValueMap({{{0x3e20ec8?, 0xc000515ef0?}}, {0x315d760?, 0x5a112e0?}}) github.com/zclconf/go-cty@v1.15.1-0.20241111215639-63279be090d7/cty/value_ops.go:1449 +0x65 github.com/hashicorp/terraform/internal/lang/funcs.MakeTemplateFileFunc.makeRenderTemplateFunc.func4({0x3e21108, 0xc00158a240}, {{{0x3e20ec8?, 0xc000515ef0?}}, {0x315d760?, 0x5a112e0?}}) github.com/hashicorp/terraform/internal/lang/funcs/string.go:322 +0xea github.com/hashicorp/terraform/internal/lang/funcs.MakeTemplateFileFunc.func3({0xc0037b5800?, 0xc000515ef0?, 0x315d760?}, {{0x3e21598?, 0x5a43160?}}) github.com/hashicorp/terraform/internal/lang/funcs/filesystem.go:148 +0x245 github.com/zclconf/go-cty/cty/function.Function.Call({0x3e20ec8?}, {0xc0037b5800, 0x2, 0x2}) github.com/zclconf/go-cty@v1.15.1-0.20241111215639-63279be090d7/cty/function/function.go:353 +0x6bf github.com/hashicorp/hcl/v2/hclsyntax.(*FunctionCallExpr).Value(0xc001210d20, 0xc001c698c0) github.com/hashicorp/hcl/v2@v2.23.0/hclsyntax/expression.go:528 +0x1acf github.com/hashicorp/hcl/v2/hclsyntax.(*FunctionCallExpr).Value(0xc001210e10, 0xc001c698c0) github.com/hashicorp/hcl/v2@v2.23.0/hclsyntax/expression.go:493 +0x1304 github.com/hashicorp/hcl/v2/hclsyntax.(*ObjectConsExpr).Value(0xc0012477c0, 0xc001c698c0) github.com/hashicorp/hcl/v2@v2.23.0/hclsyntax/expression.go:1211 +0x264 github.com/hashicorp/hcl/v2/hclsyntax.(*TupleConsExpr).Value(0xc001247860, 0xc001c698c0) github.com/hashicorp/hcl/v2@v2.23.0/hclsyntax/expression.go:1147 +0x108 github.com/hashicorp/hcl/v2/hclsyntax.(*FunctionCallExpr).Value(0xc0012110e0, 0xc001c698c0) github.com/hashicorp/hcl/v2@v2.23.0/hclsyntax/expression.go:493 +0x1304 github.com/hashicorp/hcl/v2/hcldec.(*AttrSpec).decode(0xc0039eb6e0, 0xc0031f6ea8?, {0xc00204c4e8?, 0x8?, 0x28?}, 0xc001c698c0) github.com/hashicorp/hcl/v2@v2.23.0/hcldec/spec.go:220 +0x1fc github.com/hashicorp/hcl/v2/hcldec.ObjectSpec.decode(0xc0039eb140, 0xc00154a540, {0x0, 0x0, 0x0}, 0xc001c698c0) github.com/hashicorp/hcl/v2@v2.23.0/hcldec/spec.go:94 +0x1f8 github.com/hashicorp/hcl/v2/hcldec.decode({0x3e22ad0, 0xc0015959c0}, {0x0, 0x0, 0x0}, 0xc001c698c0, {0x3e216[18](https://github.com/GLS-Spain/infrastructure-aragon/actions/runs/12048395705/job/33592927583#step:6:19), 0xc0039eb140}, 0x0) github.com/hashicorp/hcl/v2@v2.23.0/hcldec/decode.go:24 +0x10f github.com/hashicorp/hcl/v2/hcldec.Decode(...) github.com/hashicorp/hcl/v2@v2.23.0/hcldec/public.go:18 github.com/hashicorp/terraform/internal/lang.(*Scope).EvalBlock(0xc0033ae5a0, {0x3e21060, 0xc001ed8910}, 0xc0021ca630) github.com/hashicorp/terraform/internal/lang/eval.go:75 +0x[20](https://github.com/GLS-Spain/infrastructure-aragon/actions/runs/12048395705/job/33592927583#step:6:21)7 github.com/hashicorp/terraform/internal/terraform.(*BuiltinEvalContext).EvaluateBlock(0xc001c97ad0?, {0x3e[21](https://github.com/GLS-Spain/infrastructure-aragon/actions/runs/12048395705/job/33592927583#step:6:22)390, 0xc0012a56b0}, 0xc0021ca630, {0x0?, 0x0?}, {{{{0x0, 0x0}}, {0x0, 0x0}}, ...}) github.com/hashicorp/terraform/internal/terraform/eval_context_builtin.go:324 +0x145 github.com/hashicorp/terraform/internal/terraform.(*NodeValidatableResource).validateResource(0xc0008e9ca8, {0x3e48bb8, 0xc003334300}) github.com/hashicorp/terraform/internal/terraform/node_resource_validate.go:348 +0x7[26](https://github.com/GLS-Spain/infrastructure-aragon/actions/runs/12048395705/job/33592927583#step:6:27) github.com/hashicorp/terraform/internal/terraform.(*NodeValidatableResource).Execute(0xc0008e9ca8, {0x3e48bb8, 0xc003334300}, 0x0?) github.com/hashicorp/terraform/internal/terraform/node_resource_validate.go:56 +0xb8 github.com/hashicorp/terraform/internal/terraform.(*ContextGraphWalker).Execute(0xc00082c000, {0x3e48bb8, 0xc003334300}, {0x7f49d2ef7c78, 0xc0008e9ca8}) github.com/hashicorp/terraform/internal/terraform/graph_walk_context.go:161 +0xb5 github.com/hashicorp/terraform/internal/terraform.(*Graph).walk.func1({0x36b4c40, 0xc0008e9ca8}) github.com/hashicorp/terraform/internal/terraform/graph.go:143 +0x7c3 github.com/hashicorp/terraform/internal/dag.(*Walker).walkVertex(0xc00158d560, {0x36b4c40, 0xc0008e9ca8}, 0xc00120[29](https://github.com/GLS-Spain/infrastructure-aragon/actions/runs/12048395705/job/33592927583#step:6:30)80) github.com/hashicorp/terraform/internal/dag/walk.go:384 +0x2d1 created by github.com/hashicorp/terraform/internal/dag.(*Walker).Update in goroutine 1 github.com/hashicorp/terraform/internal/dag/walk.go:[30](https://github.com/GLS-Spain/infrastructure-aragon/actions/runs/12048395705/job/33592927583#step:6:31)7 +0xfb3 . ### Expected Behavior validation should pass without problems ### Actual Behavior Error in validation of every resource that has templatefile ### Steps to Reproduce In a Github actions pipeline, with a resource that uses a templatefile: - name: Setup Terraform uses: hashicorp/setup-terraform@v3 with: cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} - name: Terraform Validate id: validate run: terraform validate -no-color ### Additional Context Fixing an older version solves the problem - name: Setup Terraform uses: hashicorp/setup-terraform@v3 with: terraform_version: "1.9.7" cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} ### References _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.