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

Error: Provider produced inconsistent final plan #30

Open
caryyu opened this issue Aug 17, 2020 · 1 comment
Open

Error: Provider produced inconsistent final plan #30

caryyu opened this issue Aug 17, 2020 · 1 comment

Comments

@caryyu
Copy link

caryyu commented Aug 17, 2020

if the for_each in place, the second round can't be successfully applied, even if the first got succeeded(which helm ls can work and show the proper results )

Versions

➜ terraform version
Terraform v0.12.28
+ provider.helmfile v0.3.16

tfvars

environments = {
  test = {
    consumer_service = "v2"
    goods_service = "v2"
    cart_service = "v2"
  }

  dev1 = {
    consumer_service = "v2"
    goods_service = "v2"
    cart_service = "v2"
  }
}

terraform code

variable "environments" {}
variable "namespaces" {
  default = {
    "test" = "tech-test"
  }
}


resource "helmfile_release_set" "helmfile_release" { 
  for_each = var.environments
  working_directory = ".terraform/modules/deploy/"
  content = file(".terraform/modules/deploy/helmfile.yaml")
  environment = "default"
  concurrency = 1
  environment_variables = merge(each.value, {
    name = each.key
    namespace = lookup(var.namespaces, each.key, "tech-dev") 
  })
  depends_on = [
    module.deploy
  ]
}

Output

➜ terraform apply --parallelism=1 -auto-approve
helmfile_release_set.helmfile_release["test"]: Creating...
helmfile_release_set.helmfile_release["test"]: Still creating... [10s elapsed]
helmfile_release_set.helmfile_release["test"]: Still creating... [20s elapsed]
helmfile_release_set.helmfile_release["test"]: Still creating... [30s elapsed]
helmfile_release_set.helmfile_release["test"]: Creation complete after 35s [id=bssvfole8ppekekulrcg]

Error: Provider produced inconsistent final plan

When expanding the plan for helmfile_release_set.helmfile_release["dev1"] to
include new values learned so far during apply, provider
"registry.terraform.io/-/helmfile" produced an invalid new value for
.diff_output: was cty.StringVal("Adding repo ...

...


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

A piece of Trace

2020-08-17T11:39:40.234+0800 [DEBUG] plugin.terraform-provider-helmfile_v0.3.16: 2020/08/17 11:39:40 [DEBUG] Unlocking ".terraform/modules/china-deploy/"
2020-08-17T11:39:40.234+0800 [DEBUG] plugin.terraform-provider-helmfile_v0.3.16: 2020/08/17 11:39:40 [DEBUG] Unlocked ".terraform/modules/china-deploy/"
2020-08-17T11:39:40.234+0800 [DEBUG] plugin.terraform-provider-helmfile_v0.3.16: 2020/08/17 11:39:40 Writing diff file to .terraform/helmfile/diff-0d61dda974b408c0124baa9d71fcaf530c3b0f5661c2d38ab89aa80e36569406
2020/08/17 11:39:40 [WARN] Provider "registry.terraform.io/-/helmfile" produced an invalid plan for helmfile_release_set.helmfile_release["dev1"], but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .binary: planned value cty.StringVal("helmfile") does not match config value cty.NullVal(cty.String)
      - .dirty: planned value cty.False does not match config value cty.NullVal(cty.Bool)
      - .helm_binary: planned value cty.StringVal("helm") does not match config value cty.NullVal(cty.String)
2020/08/17 11:39:40 [TRACE] <root>: eval: *terraform.EvalCheckPlannedChange
2020/08/17 11:39:40 [TRACE] EvalCheckPlannedChange: Verifying that actual change (action Create) matches planned change (action Create)
2020/08/17 11:39:40 [ERROR] <root>: eval: *terraform.EvalCheckPlannedChange, err: Provider produced inconsistent final plan: When expanding the plan for helmfile_release_set.helmfile_release["dev1"] to include new values learned so far during apply, provider "registry.terraform.io/-/helmfile" produced an invalid new value for .diff_output: was cty.StringVal("


...


2020/08/17 11:39:40 [ERROR] <root>: eval: *terraform.EvalSequence, err: Provider produced inconsistent final plan: When expanding the plan for helmfile_release_set.helmfile_release["dev1"] to include new values learned so far during apply, provider "registry.terraform.io/-/helmfile" produced an invalid new value for .diff_output: was cty.StringVal("
@mumoshu
Copy link
Owner

mumoshu commented Aug 30, 2020

@caryyu Hey! Thanks for the detailed report. I believe this can happen due to the same cause as #28 and another one that was fixed while addressing #28.

I've just release v0.4.0 that should fix the both issues. Would you mind giving it a shot? Also upgrading Helmfile to v0.126.0 is highly recommended to solve #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants