Open Nello-Angelo opened 1 week ago
the same error
source_plugin_name = optional(string)
source_kustomize_common_annotations = optional(map(string))
source_kustomize_common_labels = optional(map(string))
source_kustomize_images = optional(set(string))
source_kustomize_name_prefix = optional(string)
source_kustomize_name_suffix = optional(string)
source_kustomize_version = optional(string)
kustomize {
name_prefix = each.value.source_kustomize_name_prefix
name_suffix = each.value.source_kustomize_name_suffix
version = each.value.source_kustomize_version
common_annotations = each.value.source_kustomize_common_annotations
common_labels = each.value.source_kustomize_common_labels
images = each.value.source_kustomize_images
}
plugin {
name = each.value.source_plugin_name
dynamic "env" {
for_each = { for i in each.value.env : format("%s-%s", i.name, i.value) => i }
content {
name = env.value.name
value = env.value.value
}
}
}
So what exactly are you trying to acomplish that let's the provider crash? Would you mind adding some steps to reproduce the issue (including a full example resource)?
what my resource looks like doesn’t matter; I get this error if the values of the passed variables remain empty and optional
in the plugin block for example if i use dynamic and do apply
env = optional(list(object({
name = string
value = string
})), [])
i resolve with example below but now i get this
│ rpc error: code = Unknown desc = error validating and normalizing app:
│ error validating the repo: error verifying source type: multiple
│ application sources defined: Helm,Plugin
resource "argocd_application" "multiple_sources" {
for_each = { for key, value in var.multiple_sources_app : key => value }
....
}
env = optional(list(object({
name = string
value = string
})), [{ "name" = "", "value" = "" }])
+ create
Terraform will perform the following actions:
# module.argocd-resources.argocd_application.multiple_sources["gitlab-runner-infra"] will be created
+ resource "argocd_application" "multiple_sources" {
+ cascade = true
+ id = (known after apply)
+ status = (known after apply)
+ validate = true
+ wait = false
+ metadata {
+ generation = (known after apply)
+ name = "gitlab-runner-infra"
+ namespace = "argocd"
+ resource_version = (known after apply)
+ uid = (known after apply)
}
+ spec {
+ project = "default"
+ revision_history_limit = 10
+ destination {
name = null
+ namespace = "gitlab-runner"
+ server = "https://kubernetes.default.svc"
}
+ source {
+ chart = "gitlab-runner"
+ path = "."
+ repo_url = "http://charts.gitlab.io/"
+ target_revision = "0.70.1"
+ helm {
+ value_files = [
+ null,
]
}
}
+ sync_policy {
+ sync_options = [
+ "CreateNamespace=true",
]
+ automated {
+ prune = true
+ self_heal = true
}
+ managed_namespace_metadata {
+ annotations = {
+ "argocd.argoproj.io/managed-by" = "argocd"
}
+ labels = {
+ "argocd.argoproj.io/managed-by" = "argocd"
}
}
+ retry {
+ limit = "5"
+ backoff {
+ duration = "5s"
+ factor = "2"
+ max_duration = "3m"
}
}
}
}
+ timeouts {}
}
Plan: 1 to add, 0 to change, 0 to destroy.
module.argocd-resources.argocd_application.multiple_sources["gitlab-runner-infra"]: Creating...
╷
│ Warning: Value for undeclared variable
│
│ The root module does not declare a variable named "cloudflare_token" but a
│ value was found in file ".secrets.auto.tfvars". If you meant to use this
│ value, add a "variable" block to the configuration.
│
│ To silence these warnings, use TF_VAR_... environment variables to provide
│ certain "global" settings to all configurations in your organization. To
│ reduce the verbosity of these warnings, use the -compact-warnings option.
╵
╷
│ Error: Plugin did not respond
│
│ The plugin encountered an error, and failed to respond to the
│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
Stack trace from the terraform-provider-argocd_v7.0.3 plugin:
panic: interface conversion: interface {} is nil, not string
goroutine 95 [running]:
github.com/oboukili/terraform-provider-argocd/argocd.expandApplicationSourceHelm({0xc000fe4130, 0xc000fd3380?, 0x3534eed?})
github.com/oboukili/terraform-provider-argocd/argocd/structure_application.go:250 +0x994
github.com/oboukili/terraform-provider-argocd/argocd.expandApplicationSource({0xc000fe40d0, 0x1, 0x3537ddd?})
github.com/oboukili/terraform-provider-argocd/argocd/structure_application.go:88 +0x29d
github.com/oboukili/terraform-provider-argocd/argocd.expandApplicationSpec(0x0?)
github.com/oboukili/terraform-provider-argocd/argocd/structure_application.go:54 +0x33f
github.com/oboukili/terraform-provider-argocd/argocd.expandApplication(_)
github.com/oboukili/terraform-provider-argocd/argocd/structure_application.go:16 +0x10d
github.com/oboukili/terraform-provider-argocd/argocd.resourceArgoCDApplicationCreate({0x3c00320?, 0xc0003bb960}, 0x0?, {0x32d5ec0?, 0xc0001b8500})
github.com/oboukili/terraform-provider-argocd/argocd/resource_argocd_application.go:86 +0xe8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc000641b20, {0x3c00278, 0xc000ecccf0}, 0xd?, {0x32d5ec0, 0xc0001b8500})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:806 +0x11b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000641b20, {0x3c00278, 0xc000ecccf0}, 0xc000d01520, 0xc0002a1e80, {0x32d5ec0, 0xc0001b8500})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:937 +0xa89
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000a01890, {0x3c00278?, 0xc000eccb40?}, 0xc0003340f0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/grpc_provider.go:1153 +0xdbc
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ApplyResourceChange({{0x3c1b[84](https://git.sbercloud.tech/dsworks/infrastructure/-/jobs/7376317#L84)0?, 0xc000a01890?}}, {0x3c00278, 0xc000eccb40}, 0x0?)
github.com/hashicorp/terraform-plugin-mux@v0.16.0/tf5to6server/tf5to6server.go:38 +0x54
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ApplyResourceChange(0x3c002b0?, {0x3c00278?, 0xc000ecc840?}, 0xc0003340a0)
github.com/hashicorp/terraform-plugin-mux@v0.16.0/tf6muxserver/mux_server_ApplyResourceChange.go:36 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0xc00099fb80, {0x3c00278?, 0xc000e97e30?}, 0xc0000f27e0)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:865 +0x3d0
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x340da20?, 0xc00099fb80}, {0x3c00278, 0xc000e97e30}, 0xc0002a1200, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:518 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000184600, {0x3c00278, 0xc000e97da0}, {0x3c0f940, 0xc000982000}, 0xc000ec4a20, 0xc000d9c930, 0x5904[85](https://git.sbercloud.tech/dsworks/infrastructure/-/jobs/7376317#L85)8, 0x0)
google.golang.org/grpc@v1.63.2/server.go:1369 +0xe23
google.golang.org/grpc.(*Server).handleStream(0xc000184600, {0x3c0f940, 0xc000982000}, 0xc000ec4a20)
google.golang.org/grpc@v1.63.2/server.go:1780 +0x1016
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 40
google.golang.org/grpc@v1.63.2/server.go:1030 +0x135
Error: The terraform-provider-argocd_v7.0.3 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
can we ignore this block if fields are null ?
+ helm {
+ value_files = [
+ null,
]
}
}
@the-technat
@the-technat can you watch this panic?
Will do, but will take some days before I get time for it.
does it correct behavior?