hashicorp / terraform-provider-helm

Terraform Helm provider
https://www.terraform.io/docs/providers/helm/
Mozilla Public License 2.0
997 stars 368 forks source link

Helm-release or modules fails to install with `unable to recognize "": unknown` error #1175

Open novy4 opened 1 year ago

novy4 commented 1 year ago

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: v1.5.2
Helm Provider version: 2.10.x
EKS version: 1.27
Kubernetes provider: 2.21.1
AWS terraform provider version: 5.5.0 

Affected Resource(s)

Terraform Configuration Files

module "eks-lb-controller" {
  source  = "DNXLabs/eks-lb-controller/aws"
  version = "0.7.0"
  cluster_name = local.env
  cluster_identity_oidc_issuer = local.oidc.url
  cluster_identity_oidc_issuer_arn = local.oidc.arn

}

Debug Output

NOTE: In addition to Terraform debugging, please set HELM_DEBUG=1 to enable debugging info from helm. debug logs trace:

2023-07-06T12:04:45.844+0300 [TRACE] provider.terraform-provider-helm_v2.10.1_x5: Called downstream: @module=sdk.helper_schema tf_provider_addr=provider tf_resource_type=helm_release @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/resource.go:838 tf_req_id=bf77dee2-a562-bb71-d173-dd2c7a063baf tf_rpc=ApplyResourceChange timestamp=2023-07-06T12:04:45.844+0300
2023-07-06T12:04:45.844+0300 [TRACE] provider.stdio: received data: channel=STDERR len=99
2023-07-06T12:04:45.845+0300 [TRACE] provider.stdio: waiting for stdio data
2023-07-06T12:04:45.844+0300 [TRACE] provider.terraform-provider-helm_v2.10.1_x5: Received downstream response: @module=sdk.proto tf_proto_version=5.3 tf_provider_addr=provider tf_req_id=bf77dee2-a562-bb71-d173-dd2c7a063baf tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tf5serverlogging/downstream_request.go:37 diagnostic_error_count=1 diagnostic_warning_count=0 tf_req_duration_ms=3715 tf_resource_type=helm_release timestamp=2023-07-06T12:04:45.844+0300
2023-07-06T12:04:45.845+0300 [ERROR] provider.terraform-provider-helm_v2.10.1_x5: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/diag/diagnostics.go:55 diagnostic_detail= diagnostic_severity=ERROR tf_provider_addr=provider tf_rpc=ApplyResourceChange @module=sdk.proto diagnostic_summary="failed to install CRD crds/crd-alertmanagerconfigs.yaml: unable to recognize "": unknown" tf_proto_version=5.3 tf_req_id=bf77dee2-a562-bb71-d173-dd2c7a063baf tf_resource_type=helm_release timestamp=2023-07-06T12:04:45.844+0300
2023-07-06T12:04:45.845+0300 [TRACE] provider.terraform-provider-helm_v2.10.1_x5: Served request: tf_rpc=ApplyResourceChange @module=sdk.proto tf_proto_version=5.3 tf_provider_addr=provider tf_req_id=bf77dee2-a562-bb71-d173-dd2c7a063baf tf_resource_type=helm_release @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:831 timestamp=2023-07-06T12:04:45.844+0300
2023-07-06T12:04:46.530+0300 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-07-06T12:04:46.538+0300 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/helm/2.10.1/darwin_arm64/terraform-provider-helm_v2.10.1_x5 pid=82763
2023-07-06T12:04:46.538+0300 [DEBUG] provider: plugin exited

Steps to Reproduce

  1. terraform apply

Expected Behavior

Terraform should deploy helm release of prometheus-stack or DNXLabs/eks-lb-controller/aws

Actual Behavior

I am getting an error: Error: failed to install CRD crds/crd-alertmanagerconfigs.yaml: unable to recognize "": unknown or for lb-ingress-controller Error: failed to install CRD crds/crds.yaml: unable to recognize "": unknown

Community Note

arybolovlev commented 1 year ago

Hi @novy4,

Have you tried to reproduce this issue with the Helm provider outside of the modules? It is hard to say what is happening inside the module and would be helpful if we can focus only on the Helm provider part only.

Please share your Helm provider resource code and any additional inputs that can help to reproduce the issue. For example, a CRD file.

Thank you.

novy4 commented 1 year ago

Hi @novy4,

Have you tried to reproduce this issue with the Helm provider outside of the modules? It is hard to say what is happening inside the module and would be helpful if we can focus only on the Helm provider part only.

Please share your Helm provider resource code and any additional inputs that can help to reproduce the issue. For example, a CRD file.

Thank you.

Hi @arybolovlev , would it be okay to post here debug info during Prometheus-stack helm release deployment?

arybolovlev commented 1 year ago

I think the debug output is quite big, so please use GitHub Gist and then paste a link here.

Thanks!

novy4 commented 1 year ago

@arybolovlev I have some trace logs for the helm-release as follows:

resource "helm_release" "monitoring" {
  count       = local.stg ? 1 : 0
  name  = local.env
  repository = "https://prometheus-community.github.io/helm-charts"
  chart = "kube-prometheus-stack"
  namespace = "tools"
  version = "47.2.0"
  values  = ["${file("monitoring/prometheus-operator.yaml")}"]
}

Trace log

if you need more info, just ping me...

novy4 commented 1 year ago

hi @arybolovlev any chance to look into this issue any time soon?

corkupine commented 11 months ago

@novy4 - were ever able to make progress? I am seeing the same behavior when attempting to run EKS Blueprints for Terraform including an addon, and opened an issue there

My provider was not authenticating properly. Error was a bit of a red herring