terraform-provider-helm: error: failed to download (hint:running helm repo update may help)
⚠️ Note from maintainers about this issue, please read
This issue is attracting a lot of thumbs because it is not one specific issue. This error message comes from the helm package and is a catch-all error that is displayed when the chart fails to download for any reason. The real error is suppressed and debugging has to be enabled to surface it.
Please add HELM_DEBUG=1 to your terraform apply and run again to see if the error message is more specific. If the error message shows something different please open a new issue with the output.
Original Issue
Terraform Version and Provider Version
Terraform v0.12.26
Provider Version
- provider.google v3.27.0
- provider.google-beta v3.27.0
- provider.helm v1.2.3
- provider.random v2.2.1
Affected Resource(s)
- helm_release
Terraform Configuration Files
Provider in root module
provider "helm" {
kubernetes {
config_context = "name-of-my-context"
}
}
Basics of the module
resource "helm_release" "gitlab-runner" {
name = "gitlab-runner"
repository = "https://charts.gitlab.io"
chart = "gitlab-runner"
version = "0.18.0"
namespace = "gitlab-runner"
create_namespace = true
...
}
Execution of the root module
module "gitlab_runner" {
source = "../modules/helm_gitlab_runner"
tags = "test, test2"
registration_token = "removed"
}
Expected Behavior
Chart should be successfully downloaded and the plan applied
Actual Behavior
helm_release.gitlab-runner: Creating...
Error: failed to download "https://gitlab-charts.s3.amazonaws.com/gitlab-runner-0.18.0.tgz" (hint: running `helm repo update` may help)
on main.tf line 1, in resource "helm_release" "gitlab-runner":
1: resource "helm_release" "gitlab-runner" {
Steps to Reproduce
terraform initterraform planterraform apply -auto-approve
Important Factoids
The target cluster is a GKE instance and the active kubectl ctx is correct and functions fine.
I have tried all kinds of variations here such as setting `chart = “https://gitlab-charts.s3.amazonaws.com/gitlab-runner-0.18.0.tgz” , removing version, older versions etc etc
I have done all kinds of resets of helm cache, remove and add repos, update etc etc
Have also used the terraform docker image to ensure that its not an environmental problem of some sort
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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 50
- Comments: 22 (6 by maintainers)
Hi folks, I’m pinning this issue for visibility. This issue is attracting a lot of thumbs because it is not one specific issue. This error message comes from the helm package and is a catch-all error that is displayed when the chart fails to download for any reason. The real error is suppressed and debugging has to be enabled to surface it.
Please add HELM_DEBUG=1 to your terraform apply and run again to see if the error message is more specific. If the error message shows something different please open a new issue with the output.
I’m going to close this issue now to avoid further confusion.
It worked when I used terraform 0.13 but when switching back to terraform 0.12.28 it is failing
resource “helm_release” “cluster_autoscaler” { name = “autoscaler” repository = “https://kubernetes.github.io/autoscaler” chart = “cluster-autoscaler-chart” namespace = “cluster-autoscaler”
set { name = “autoDiscovery.clusterName” value = var.cluster_name }
set { name = “rbac.create” value = true }
set { name = “rbac.serviceAccountAnnotations.eks.amazonaws.com/role-arn” value = aws_iam_role.argocd_nodegroup_role.arn }
depends_on = [aws_eks_cluster.argocd_cluster, aws_eks_node_group.argocd_nodegroup, kubernetes_namespace.cluster_autoscaler]
}
@llnformer As above, if you change:
chart = "eks/aws-node-termination-handler"tochart = "aws-node-termination-handler"The release should work.
I had a similar issue when I add
verify = trueincluded in myhelm_release. When I setverifytofalsethe error went away. I’d consider this a workaround as I don’t know why verification of the package fails.I was having this exact problem with an agones install, and was able to reproduce it while attempting a direct install too, same failure text. So I added a debug to the manual install:
helm --debug install agones https://agones.dev/chart/stable/agones-1.7.0.tgz -n agones-systemThat told me that the issue was that there was a missing file:
Error: no cached repo found. (try 'helm repo update'): open ~/.cache/helm/repository/local-index.yaml: no such file or directoryI took a guess that this was actually the file in
~/.helm/repository/local/index.yamlthat probably got missed in a helm 2to3 migration. So, I copied it over:cp ~/.helm/repository/local/index.yaml ~/.cache/helm/repository/local-index.yamllNow when I run my terraform apply, no errors (at least because of this)