Terraform-provider-helm: rpc error during Plan or Destroy with multiple helm_release

Created on 28 May 2020  ·  5Comments  ·  Source: hashicorp/terraform-provider-helm

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version and Provider Version

Provider Version

$ terraform -v
Terraform v0.12.26

  • provider.external v1.2.0
  • provider.helm v1.2.1
  • provider.ibm v1.6.0
  • provider.kubernetes v1.11.3

Affected Resource(s)

  • helm_release

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.
resource "helm_release" "go_app" {
  name       = "metrics-${var.go_app_name}"
  namespace  = "default"
  chart      = "./samples/${var.go_app_name}/chart/${var.go_app_name}"
  wait       = true

  set {
    name  = "replicaCount"
    value = 3
  }

  set {
    name  = "image.repository"
    value = var.go_image_repository
  }

  set {
    name  = "ingress.name"
    value = "${var.go_app_name}-ingress"
  }

  set {
    name  = "ingress.host"
    value = "metrics-${var.go_app_name}.${var.cluster_infrastructure == "vpc" ? data.ibm_container_vpc_cluster.cluster[0].ingress_hostname : data.ibm_container_cluster.cluster[0].ingress_hostname}"
  }

  set {
    name  = "ingress.tls.hosts"
    value = "metrics-${var.go_app_name}.${var.cluster_infrastructure == "vpc" ? data.ibm_container_vpc_cluster.cluster[0].ingress_hostname : data.ibm_container_cluster.cluster[0].ingress_hostname}"
  }

  set {
    name  = "ingress.tls.secret_name"
    value = var.cluster_infrastructure == "vpc" ? data.ibm_container_vpc_cluster.cluster[0].ingress_secret : data.ibm_container_cluster.cluster[0].ingress_secret
  }
}

resource "helm_release" "node_app" {
  name       = "metrics-${var.node_app_name}"
  namespace  = "default"
  chart      = "./samples/${var.node_app_name}/chart/${var.node_app_name}"
  wait       = true

  set {
    name  = "replicaCount"
    value = 3
  }

  set {
    name  = "image.repository"
    value = var.node_image_repository
  }

  set {
    name  = "ingress.name"
    value = "${var.node_app_name}-ingress"
  }

  set {
    name  = "ingress.host"
    value = "metrics-${var.node_app_name}.${var.cluster_infrastructure == "vpc" ? data.ibm_container_vpc_cluster.cluster[0].ingress_hostname : data.ibm_container_cluster.cluster[0].ingress_hostname}"
  }

  set {
    name  = "ingress.tls.hosts"
    value = "metrics-${var.node_app_name}.${var.cluster_infrastructure == "vpc" ? data.ibm_container_vpc_cluster.cluster[0].ingress_hostname : data.ibm_container_cluster.cluster[0].ingress_hostname}"
  }

  set {
    name  = "ingress.tls.secret_name"
    value = var.cluster_infrastructure == "vpc" ? data.ibm_container_vpc_cluster.cluster[0].ingress_secret : data.ibm_container_cluster.cluster[0].ingress_secret
  }
}

Debug Output

Panic Output

I at times get the following error during plan or destroy

Plan: 0 to add, 0 to change, 2 to destroy.

Do you really want to destroy all resources?
  Terraform will destroy all your managed infrastructure, as shown above.
  There is no undo. Only 'yes' will be accepted to confirm.

  Enter a value: yes

helm_release.node_app: Destroying... [id=metrics-node-app]
helm_release.go_app: Destroying... [id=metrics-go-app]

Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Unavailable desc = transport is closing

Expected Behavior


If I use a single helm_release these errors are never seen, I would expect it to work with 2 or more helm_release in the Terraform template.

Actual Behavior


I receive an Error: rpc error: code = Unavailable desc = transport is closing message during plan or destroy. It does not occur every single time, but when it does it only happens when I have more than one helm_release entry in the template, leading me to believe there is a concurrency issue.

Steps to Reproduce

  1. Template with two or more helm_release targeting the same Kubernetes cluster.
  2. terraform apply
  3. terraform destroy or terraform plan, it may be easier to run plan as it might be necessary to run this multiple times before the error is seen
bug

Most helpful comment

@jrhouston I ran through my scenario above a few times and I am no longer seeing the issue above. I feel comfortable that the fix worked and we can close this. Thank you.

All 5 comments

Hi @dprosper,
This issue look like duplicate of https://github.com/hashicorp/terraform-provider-helm/issues/493

@NickMetz It does look similar, I will watch for the PR to go in and re-test. Thank you

@dprosper Did the latest release fix this issue for you?

@jrhouston I ran through my scenario above a few times and I am no longer seeing the issue above. I feel comfortable that the fix worked and we can close this. Thank you.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings