Skip to content

helm_release state upgrade fails with Helm provider 3.1.1: version 0 UpgradeState missing #1870

Description

@EugenKonkov-Veem

Terraform and provider versions

Terraform required version: ~> 1.14.7
Helm provider: hashicorp/helm 3.1.1 (constraint: ~> 3.1.1)
Kubernetes provider: hashicorp/kubernetes 3.0.1
AWS provider: hashicorp/aws 6.37.0

Affected resource

  • helm_release.aws-lb-controller
  • Chart: aws-load-balancer-controller (configuration default: 3.1.0)
  • Repository: https://aws.github.io/eks-charts

Problem

Terraform cannot decode the prior state for an existing helm_release resource and then fails while upgrading the resource state.

Error output

Warning: Failed to decode resource from state

Error decoding "helm_release.aws-lb-controller" from prior state: missing expected {

Error: Unable to Upgrade Resource State

  with helm_release.aws-lb-controller,
  on controller.tf line 29, in resource "helm_release" "aws-lb-controller":
  29: resource "helm_release" "aws-lb-controller" {

This resource was implemented with an UpgradeState() method, however Terraform was
expecting an implementation for version 0 upgrade.

This is always an issue with the Terraform Provider and should be reported to the provider
developer.

Steps to reproduce (observed)

This is the observed workflow, not yet a standalone minimal reproduction:

  1. Use a Terraform state that already contains a helm_release named aws-lb-controller.
  2. Configure the Helm provider as hashicorp/helm ~> 3.1.1, resolving to 3.1.1.
  3. Configure the resource with the AWS EKS chart repository and chart shown above.
  4. Run terraform init and then terraform plan against that existing state.
  5. Terraform emits the decode warning and terminates with Unable to Upgrade Resource State, because it expects a version-0 state upgrader.

Expected behavior

The Helm provider should decode and migrate the prior helm_release state so Terraform can complete planning without requiring manual state removal or re-import.

Related reports

Those reports describe related Helm provider v3 state-migration failures, but this report captures the failure with Terraform ~> 1.14.7 and Helm provider 3.1.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions