You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for making this plugin! It's my first time writing Terraform config, so I can accept that this could be something I overlooked. The error output says that this is definitely an issue with the plugin, so I thought I'd report it.
The issue occurs during terraform apply. terraform plan succeeds in generating the execution plan.
Error message (click to expand):
Stack trace from the terraform-provider-keycloak_v3.0.1.exe plugin:
panic: interface conversion: interface {} is nil, not map[string]interface {}
goroutine 59 [running]:
github.com/mrparkers/terraform-provider-keycloak/provider.getRealmFromData(0xc000042c00, 0x0, 0x1ba5180, 0xc0005d9890)
github.com/mrparkers/terraform-provider-keycloak/provider/resource_keycloak_realm.go:647 +0x46a7
github.com/mrparkers/terraform-provider-keycloak/provider.resourceKeycloakRealmUpdate(0xc000042c00, 0x1cf7300, 0xc00024a120, 0x0,
0xffffffffffffffff)
github.com/mrparkers/terraform-provider-keycloak/provider/resource_keycloak_realm.go:1225 +0x4b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc000785130, 0x1ea3fe0, 0xc0001c2140, 0xc000042c00, 0x1cf7300, 0xc00024a120, 0x0, 0x0, 0x0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.0.2-0.20200817173939-b72757e734f6/helper/schema/resource.go:293 +0x95
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000785130, 0x1ea3fe0, 0xc0001c2140, 0xc00025a4d0,
0xc0007d20a0, 0x1cf7300, 0xc00024a120, 0x0, 0x0, 0x0, ...)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.0.2-0.20200817173939-b72757e734f6/helper/schema/resource.go:395 +0x39e
github.com/hashicorp/terraform-plugin-sdk/v2/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc000004100, 0x1ea3fe0, 0xc0001c2140, 0xc00025a0e0, 0xc000004100, 0xc000004110, 0x1d4fdb0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.0.2-0.20200817173939-b72757e734f6/internal/helper/plugin/grpc_provider.go:952 +0x8ef
github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfplugin5._Provider_ApplyResourceChange_Handler.func1(0x1ea3fe0, 0xc0001c2140, 0x1cab0e0, 0xc00025a0e0, 0xc0001c2140, 0x1be81c0, 0x1, 0xc0000a1320)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.0.2-0.20200817173939-b72757e734f6/internal/tfplugin5/tfplugin5.pb.go:3312
+0x8d
github.com/hashicorp/terraform-plugin-sdk/v2/plugin.Serve.func3.1(0x1ea40a0, 0xc000154030, 0x1cab0e0, 0xc00025a0e0, 0xc0000a1300, 0xc0000a1320, 0xc000291ba0, 0x1188756, 0x1c6b3a0, 0xc000154030)1188756, 0x1c6b3a0, 0xc000154030)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.0.2-0.20200817173939-b72757e734f6/plugin/serve.go:76 +0x97 0660, 0xc0008143a0, 0x1ea40a0, 0xc000154030, 0xc000674000, 0x1cfb)
github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1cc1240, 0xc000004100, 0x1ea40a0, 0xc000154030, 0xc000300660, 0xc0008143a0, 0x1ea40a0, 0xc000154030, 0xc000674000, 0x1cfb)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.0.2-0.20200817173939-b72757e734f6/internal/tfplugin5/tfplugin5.pb.go:3314 +0x152
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001fee00, 0x1eaea40, 0xc000644480, 0xc000122b00, 0xc0002815f0, 0x24bf7c0, 0x0, 0x0, 0x0)
google.golang.org/grpc@v1.30.0/server.go:1171 +0x522
google.golang.org/grpc.(*Server).handleStream(0xc0001fee00, 0x1eaea40, 0xc000644480, 0xc000122b00, 0x0)
google.golang.org/grpc@v1.30.0/server.go:1494 +0xce5
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000032200, 0xc0001fee00, 0x1eaea40, 0xc000644480, 0xc000122b00)
google.golang.org/grpc@v1.30.0/server.go:834 +0xa8
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.30.0/server.go:832 +0x1fd
Error: The terraform-provider-keycloak_v3.0.1.exe 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.
I've messed around with the config and was able to narrow it down to the realm SMTP settings. It looks like if I set up the config in a way where it configures email, but then provide an empty string as values, this plugin produces the error above.
Hey @DecentM, sorry that you've run into this. This is actually a bug within the terraform plugin SDK, for which I've opened an issue here: hashicorp/terraform-plugin-sdk#216
Until that's resolved, your best bet is to not set the auth configuration at all unless both var.smtp_auth_password and var.smtp_auth_username are set. You can do that with dynamic blocks like this:
Thanks for making this plugin! It's my first time writing Terraform config, so I can accept that this could be something I overlooked. The error output says that this is definitely an issue with the plugin, so I thought I'd report it.
The issue occurs during
terraform apply
.terraform plan
succeeds in generating the execution plan.Error message (click to expand):
I've messed around with the config and was able to narrow it down to the realm SMTP settings. It looks like if I set up the config in a way where it configures email, but then provide an empty string as values, this plugin produces the error above.
Configuration section (click to expand):
While I believe this is valid Keycloak configuration (when emails are disabled), it looks like the code that sets this doesn't check for empty strings here (just took this line from the stack trace): https://github.com/mrparkers/terraform-provider-keycloak/blob/c851df424c5407726b2f448fce6c70905d9dc002/provider/resource_keycloak_realm.go#L647
The text was updated successfully, but these errors were encountered: