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

Value is marked so must be unmarked first #33991

Closed ognjengrubac-tomtom closed 11 months ago

ognjengrubac-tomtom commented 11 months ago

Terraform Version

v1.6.0

Terraform Configuration Files

resource "azurerm_databricks_workspace" "this" {
  name                = var.workspace_name
  resource_group_name = var.resource_group_name
  location            = var.location
  sku                 = var.sku

  tags = var.tags
}

provider "databricks" {
  host                        = azurerm_databricks_workspace.this.workspace_url
  azure_workspace_resource_id = azurerm_databricks_workspace.this.id
}

data "databricks_spark_version" "this" {
  depends_on    = [azurerm_databricks_workspace.this]
  spark_version = var.spark_version
}

resource "databricks_cluster" "this" {
  cluster_name            = var.cluster_name
  spark_version           = data.databricks_spark_version.this.id
  node_type_id            = var.node_type_id
  autotermination_minutes = var.cluster_auto_termination_minutes

  autoscale {
    min_workers = var.cluster_min_workers
    max_workers = var.cluster_max_workers
  }

  library {
    maven {
      coordinates = "com.microsoft.azure:azure-eventhubs-spark_2.12:2.3.22"
    }
  }

  library {
    pypi {
      package = "azure-data-tables==12.4.1"
    }
  }
}

resource "databricks_mount" "data_zone" {
  for_each   = var.container_names
  cluster_id = databricks_cluster.this.id
  name       = var.databricks_data

  abfs {
    container_name         = each.value
    storage_account_name   = var.storage_account_name
    client_id              = var.client_id
    client_secret_key      = databricks_secret.general["service_principal_client_secret"].key
    client_secret_scope    = databricks_secret_scope.general.name
    initialize_file_system = false
  }
}

Debug Output

--- If needed will provide.

Expected Behavior

Terraform changes applied successfully.

Actual Behavior

value is marked, so must be unmarked first goroutine 487 [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?, 0xc000144bd1?}}, {0x2e1de40?, 0xc000f2db48?}}) /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?, 0xc000144bd1?}}, {0x2e1de40?, 0xc000f2db48?}}) /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(0xc0008409a0, 0xc000f2d650) /home/runner/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.18.0/hclsyntax/expression.go:745 +0xd35 github.com/hashicorp/hcl/v2/hclsyntax.(ObjectConsExpr).Value(0xc000842500, 0xc000f2d650) /home/runner/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.18.0/hclsyntax/expression.go:1082 +0x27e github.com/hashicorp/terraform/internal/lang.(Scope).EvalExpr(0xc00091aa20, {0x7fa71a59e838?, 0xc000842500}, {{0x3902f48?, 0x5130520?}}) /home/runner/work/terraform/terraform/internal/lang/eval.go:175 +0x1bd github.com/hashicorp/terraform/internal/terraform.(nodeModuleVariable).evalModuleVariable(0xc000ae5aa0, {0x391fb60?, 0xc000904620?}, 0x80?) /home/runner/work/terraform/terraform/internal/terraform/node_module_variable.go:248 +0x225 github.com/hashicorp/terraform/internal/terraform.(nodeModuleVariable).Execute(0xc000ae5aa0, {0x391fb60, 0xc000904620}, 0x4) /home/runner/work/terraform/terraform/internal/terraform/node_module_variable.go:183 +0x12c github.com/hashicorp/terraform/internal/terraform.(ContextGraphWalker).Execute(0xc001d25200, {0x391fb60, 0xc000904620}, {0x7fa71a444118, 0xc000ae5aa0}) /home/runner/work/terraform/terraform/internal/terraform/graph_walk_context.go:143 +0xbe github.com/hashicorp/terraform/internal/terraform.(Graph).walk.func1({0x2f07ca0, 0xc000ae5aa0}) /home/runner/work/terraform/terraform/internal/terraform/graph.go:78 +0x375 github.com/hashicorp/terraform/internal/dag.(Walker).walkVertex(0xc000ae5b60, {0x2f07ca0, 0xc000ae5aa0}, 0xc000a91b40) /home/runner/work/terraform/terraform/internal/dag/walk.go:384 +0x2e5 created by github.com/hashicorp/terraform/internal/dag.(*Walker).Update in goroutine 268 /home/runner/work/terraform/terraform/internal/dag/walk.go:307 +0xde8

Steps to Reproduce

terraform-bin plan -out=tf.tfplan -target=module.databricks.databricks_mount.data_zone -replace=module.databricks.databricks_mount.data_zone["dbdata"]

Additional Context

No response

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.