Terraform-provider-helm: Inconsistent final plan on Terraform Cloud

Created on 12 Sep 2019  路  11Comments  路  Source: hashicorp/terraform-provider-helm

Terraform Version

v0.12.8

Affected Resource(s)

  • helm_release
  • helm_repository

Terraform Configuration Files

data "helm_repository" "loki" {
  name     = "loki"
  url      = "https://grafana.github.io/loki/charts"
}

resource "helm_release" "promtail" {
  name       = "promtail"
  repository = data.helm_repository.loki.metadata.0.name
  chart      = "promtail"
  namespace  = "monitoring"
}

Debug Output

No idea how to grab this with Terraform cloud.

Expected Behavior

Should install Helm chart

Actual Behavior

Error: Provider produced inconsistent final plan

When expanding the plan for module.dev-cluster-services.helm_release.promtail
to include new values learned so far during apply, provider "helm" produced an
invalid new value for .version: was known, but now unknown.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Steps to Reproduce

  1. Try to install a chart with a custom repository using Terraform Cloud (with remote runs)

Important Factoids

Works fine locally

References

  • Might be related to #335, even though it's a different error.
acknowledged bug

Most helpful comment

Still happens with the 1.0 release and helm3

All 11 comments

Also seeing this trying to deploy istio

Error: Provider produced inconsistent final plan

When expanding the plan for module.istio.helm_release.istio-init to include
new values learned so far during apply, provider "helm" produced an invalid
new value for .version: was known, but now unknown.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Seeing the same thing here with multiple different Helm Charts.

Workaround: change your helm_repository from a data to a resource type. This is the old behavior of this module and is technically deprecated, but works.

resource "helm_repository" "incubator" {
    name = "incubator"
    url  = "https://kubernetes-charts-incubator.storage.googleapis.com"
}

Changing the resource from data to resource only works for the next plan.

The way I've been getting around this issue is as follows, but its far from perfect.

Just put the URL you want the release to be installed from into the "repository" field.

This should really be better documented.

resource "helm_release" "metricbeat" {
  name      = "metricbeat"
  namespace = "kube-system"
  version   = "7.4.0"

  repository = "https://helm.elastic.co"
  chart      = "metricbeat"

  set = ["${var.set}"]

  values = [
    "${data.template_file.metricbeat-values.rendered}",
  ]
}

Still happens with the 1.0 release and helm3

@NickCarton your workaround is still valid as I'm still getting the same issue when using helm_repository as data

Still happens with the 1.0 release and helm3

+2. I am facing that same problem as well. (NEVERMIND)

I found my problem and it is that I was trying to deploy a chart in a nonexistent namespace.

Closing this issue since is making reference to a version based on Helm 2, if this is still valid to the master branch please reopen it. Thanks.

@mcuadros this still happens with the latest release and helm3. @brpaz also posted this and his comment has 8 thumbs ups.
In my case I just keep on rerunning atm, it sometimes succeeds. We deploy a local helm chart by just point to it on the filesystem.
I actually didn't have this happend with helm2 only with helm3. We create a Horizontal Pod Autoscaler since that isn't completely supported via terraform provider.

Still happens with provider version = "~> 1.1.1"
When expanding the plan for helm_release.helm_release_chart to include new
values learned so far during apply, provider "registry.terraform.io/-/helm"
produced an invalid new value for .version: was
cty.StringVal("2020.0417.085602"), but now cty.StringVal("2020.0417.085603").

As @NickCarton suggested, the thing to do here is use the URL directly in the helm_release. We are deprecating the helm_repository data source and will be updating the documentation here: https://github.com/terraform-providers/terraform-provider-helm/commit/5b5d01fa0bc67b5a6781f7979dc075a3d3e8d0ec

Was this page helpful?
0 / 5 - 0 ratings