Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/v3 unable to read prior state #1574

Open
utahcon opened this issue Jan 27, 2025 · 0 comments
Open

provider/v3 unable to read prior state #1574

utahcon opened this issue Jan 27, 2025 · 0 comments
Assignees
Labels

Comments

@utahcon
Copy link

utahcon commented Jan 27, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants