Skip to content

provider/v3 unable to read prior state #1574

@utahcon

Description

@utahcon

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: 1.10.5
Provider version: 3.0.0-pre1
Kubernetes version: 1.32 (eks.2)

Affected Resource(s)

  • helm_release

Terraform Configuration Files

resource "helm_release" "karpenter" {
  chart      = "karpenter"
  name       = "karpenter"
  namespace  = "kube-system"
  version    = "1.1.2"
  repository = "oci://public.ecr.aws/karpenter"

  values = [
    templatefile("${path.module}/karpenter/values.yaml", {
      CLUSTER_NAME       = local.cluster.name
      KARPENTER_ROLE_ARN = data.terraform_remote_state.eks.outputs.karpenter.role.arn
    })
  ]

  wait = true

  timeout = 60
}

Debug Output

https://gist.githubusercontent.com/utahcon/2e12436524c7b79e65cc98cd85248aa3/raw/d20e9016cabe95a4cf61f56776d66baf63eb9794/tfp.log

Steps to Reproduce

  1. Change from helm provider 2.17.0 to 3.0.0-pre1
  2. terraform init --upgrade
  3. Updated kubernetes configuration object, and set parameters for helm_release
  4. terraform plan

Expected Behavior

Terraform is expected to pull the previous state, parse the files, and then compare the new configuration for changes.

Actual Behavior

Terraform and the Helm provider are unable to parse the existing state using the new provider

╷
│ Warning: Failed to decode resource from state
│ 
│ Error decoding "helm_release.karpenter" from prior state: missing expected {
╵
╷
│ Error: Unable to Read Previously Saved State for UpgradeResourceState
│ 
│   with helm_release.karpenter,
│   on karpenter.tf line 45, in resource "helm_release" "karpenter":45: resource "helm_release" "karpenter" {
│ 
│ There was an error reading the saved resource state using the current resource schema.
│ 
│ If this resource state was last refreshed with Terraform CLI 0.11 and earlier, it must be refreshed or applied with an older provider version first. If you manually modified the resource state, you will need to manually modify it to
│ match the current resource schema. Otherwise, please report this to the provider developer:
│ 
│ AttributeName("metadata"): invalid JSON, expected "{", got "["

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions