Terraform Upgrade to 1.0.0 issue: Call to function "concat" failed: panic with sensitive values

Hello,

I am having issues with a terraform upgrade from 0.14.4 to 1.0.0 in which I solved it by REMOVING the sensitive = true from the variable. But I wanted to share this… since I got a crash.

Where the variables are:

locals {
local_ips = [“10.0.0.0/8”, “127.0.0.0/8”, “172.0.0.0/8”]
}

allowed_ips_to_access set to sensitive

variable “allowed_ips_to_access” {
type = list
sensitive = true
description = “Addresses that are whitelisted to access resources”
}

As mentioned I solved this by removing sensitive = true but I would like to put it back. Thanks!

Error: Error in function call
│ 
│   on ../../tfmodules/helm_prometheus_observer/vars.tf line 110, in locals:
│  110:     whitelisted_ips           = join(",",concat(var.allowed_ips_to_access, local.local_ips)),
│     ├────────────────
│     │ local.local_ips is tuple with 3 elements
│     │ var.allowed_ips_to_access has a sensitive value
│ 
│ Call to function "concat" failed: panic in function
│ implementation: value is marked, so must be unmarked first
│ goroutine 1837 [running]:
│ runtime/debug.Stack(0xc0025f5c48, 0x2f875c0, 0x381c670)
│       /usr/local/go/src/runtime/debug/stack.go:24 +0x9f
│ github.com/zclconf/go-cty/cty/function.errorForPanic(...)
│       /home/circleci/go/pkg/mod/github.com/zclconf/go-cty@v1.8.3/cty/function/error.go:44
│ github.com/zclconf/go-cty/cty/function.Function.ReturnTypeForValues.func1(0xc0025f6100,
│ 0xc0025f6110)
│       /home/circleci/go/pkg/mod/github.com/zclconf/go-cty@v1.8.3/cty/function/function.go:217
│ +0x7c
│ panic(0x2f875c0, 0x381c670)
│       /usr/local/go/src/runtime/panic.go:965 +0x1b9
│ github.com/zclconf/go-cty/cty.Value.assertUnmarked(...)
│       /home/circleci/go/pkg/mod/github.com/zclconf/go-cty@v1.8.3/cty/marks.go:141
│ github.com/zclconf/go-cty/cty.Value.LengthInt(0x38b8708,
│ 0xc0025b6ae0, 0x3150f20, 0xc001bda9a8, 0x1)
│       /home/circleci/go/pkg/mod/github.com/zclconf/go-cty@v1.8.3/cty/value_ops.go:1050
│ +0x4f
│ github.com/zclconf/go-cty/cty/function/stdlib.glob..func78(0xc002597d80,
│ 0x2, 0x2, 0x49b2088, 0xc0025f5f88, 0x0, 0x0)
│       /home/circleci/go/pkg/mod/github.com/zclconf/go-cty@v1.8.3/cty/function/stdlib/sequence.go:58
│ +0x3ef
│ github.com/zclconf/go-cty/cty/function.Function.ReturnTypeForValues(0xc000194780,
│ 0xc002597d80, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0)
│       /home/circleci/go/pkg/mod/github.com/zclconf/go-cty@v1.8.3/cty/function/function.go:221
│ +0x4d4
│ github.com/zclconf/go-cty/cty/function.Function.Call(0xc000194780,
│ 0xc002597d80, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
│       /home/circleci/go/pkg/mod/github.com/zclconf/go-cty@v1.8.3/cty/function/function.go:228
│ +0xb5
│ github.com/hashicorp/hcl/v2/hclsyntax.(*FunctionCallExpr).Value(0xc000ac61e0,
│ 0xc001bda948, 0x0, 0xc0025b6cc0, 0x38b8698, 0xc000050470,
│ 0x38b8698, 0xc000050470, 0x2f875c0)
│       /home/circleci/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.10.0/hclsyntax/expression.go:442
│ +0xff6
│ github.com/hashicorp/hcl/v2/hclsyntax.(*FunctionCallExpr).Value(0xc000ac62d0,
│ 0xc001bda948, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
│       /home/circleci/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.10.0/hclsyntax/expression.go:408
│ +0x2406
│ github.com/hashicorp/hcl/v2/hclsyntax.(*ObjectConsExpr).Value(0xc000e1c320,
│ 0xc001bda948, 0x0, 0xc0025b6c40, 0x38b8698, 0xc000050470,
│ 0x38b8698, 0xc000050470, 0x2f875c0)
│       /home/circleci/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.10.0/hclsyntax/expression.go:808
│ +0x2ac
│ github.com/hashicorp/hcl/v2/hclsyntax.(*FunctionCallExpr).Value(0xc000ac64b0,
│ 0xc001bda948, 0x0, 0xc0013ab800, 0x1, 0x1, 0x0, 0x0, 0x0)
│       /home/circleci/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.10.0/hclsyntax/expression.go:408
│ +0x2406
│ github.com/hashicorp/terraform/internal/lang.(*Scope).EvalExpr(0xc0025ba2d0,
│ 0x38b7438, 0xc000ac64b0, 0x38b86d0, 0x49b2088, 0x0, 0x0,
│ 0x0, 0x0, 0x0, ...)
│       /home/circleci/project/project/internal/lang/eval.go:171
│ +0x1bc
│ github.com/hashicorp/terraform/internal/terraform.(*BuiltinEvalContext).EvaluateExpr(0xc002712460,
│ 0x38b7438, 0xc000ac64b0, 0x38b86d0, 0x49b2088, 0x0, 0x0,
│ 0x0, 0xffffffffffffffff, 0x0, ...)
│       /home/circleci/project/project/internal/terraform/eval_context_builtin.go:281
│ +0xbb
│ github.com/hashicorp/terraform/internal/terraform.(*NodeLocal).Execute(0xc0025b12f0,
│ 0x38ef9c0, 0xc002712460, 0xc0000a2002, 0xc001b5ece8,
│ 0x100b805, 0x30a89c0)
│       /home/circleci/project/project/internal/terraform/node_local.go:153
│ +0x67d
│ github.com/hashicorp/terraform/internal/terraform.(*ContextGraphWalker).Execute(0xc0014ef1e0,
│ 0x38ef9c0, 0xc002712460, 0x2e534858, 0xc0025b12f0, 0x0,
│ 0x0, 0x0)
│       /home/circleci/project/project/internal/terraform/graph_walk_context.go:129
│ +0xbf
│ github.com/hashicorp/terraform/internal/terraform.(*Graph).walk.func1(0x3230ec0,
│ 0xc0025b12f0, 0x0, 0x0, 0x0)
│       /home/circleci/project/project/internal/terraform/graph.go:59
│ +0xbd3
│ github.com/hashicorp/terraform/internal/dag.(*Walker).walkVertex(0xc00061b020,
│ 0x3230ec0, 0xc0025b12f0, 0xc002597500)
│       /home/circleci/project/project/internal/dag/walk.go:381
│ +0x288
│ created by
│ github.com/hashicorp/terraform/internal/dag.(*Walker).Update
│       /home/circleci/project/project/internal/dag/walk.go:304
│ +0x1246
│ .
╵