-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The provider crashes when fields are explicitly set to null #522
Comments
@mkonopi are you able to share your terraform module reproducing this issue? |
This happens once in a while and then there is not much I can do. Need to remove cluster from EC and run code again. I can see TF provider was last time updated 3 months ago. Archive.zip |
I can consistently create a similar error. The I have tried versions
As you can see from the error, it mentions I've had a look at the module provided by @mkonopi and I can see we are doing something very similar. Here's how I am handling the
It seems that @mkonopi is also doing the (as far as I know, fairly standard) trick of using a My work-around is to just enable Kibana everywhere and hardcode the |
Setting a field to
null
should be handled the same as if the field was not defined at all. Most places where the provider casts those fields into another type do not handle anil
value and cause the provider to crash.For example, this deployment will cause a crash when expanding the kibana config
Started having this error when deploying trough terraform:
│ Error: Plugin did not respond
│
│ with module.ec.ec_deployment.ec_cluster,
│ on .terraform/modules/ec/main.tf line 5, in resource "ec_deployment" "ec_cluster":
│ 5: resource "ec_deployment" "ec_cluster" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
Stack trace from the terraform-provider-ec_v0.4.1 plugin:
panic: interface conversion: interface {} is nil, not map[string]interface {}
goroutine 38 [running]:
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource.expandEsTopology({0xeb9380, 0xc000522420}, {0xc00052a050, 0x7, 0x9})
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource/elasticsearch_expanders.go:186 +0x8f7
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource.expandEsResource({0xf48d40, 0xc0002de600}, 0xc00053d1d0)
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource/elasticsearch_expanders.go:80 +0x276
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource.expandEsResources({0xc000664190, 0x1, 0x15}, 0xc0001a4f60)
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource/elasticsearch_expanders.go:51 +0xbc
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource.updateResourceToModel(0x1a3bae8, 0xc00047c3c0)
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource/expanders.go:179 +0x8bb
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource.updateDeployment({0xc0005aef60, 0xc0005aeff8}, 0xc00058a680, 0xc00047c3c0)
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource/update.go:53 +0x45
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource.updateResource({0x1256748, 0xc00059dce0}, 0xc0005af030, {0xe9d960, 0xc00047c3c0})
github.com/elastic/terraform-provider-ec/ec/ecresource/deploymentresource/update.go:36 +0x7d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc0000d61c0, {0x1256780, 0xc0004fb800}, 0xd, {0xe9d960, 0xc00047c3c0})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:741 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0000d61c0, {0x1256780, 0xc0004fb800}, 0xc0004f21a0, 0xc00058b480, {0xe9d960, 0xc00047c3c0})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:847 +0x9e5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00047d140, {0x12566d8, 0xc0002dc1c0}, 0xc0004c6d20)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe3c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00042a1e0, {0x1256780, 0xc0004fb020}, 0xc000187810)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:812 +0x56b
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x10993e0, 0xc00042a1e0}, {0x1256780, 0xc0004fb020}, 0xc00007e720, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00046afc0, {0x1266998, 0xc0001131e0}, 0xc000524a20, 0xc000346780, 0x1aa23e0, 0x0)
google.golang.org/[email protected]/server.go:1282 +0xccf
google.golang.org/grpc.(*Server).handleStream(0xc00046afc0, {0x1266998, 0xc0001131e0}, 0xc000524a20, 0x0)
google.golang.org/[email protected]/server.go:1619 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:919 +0x294
Error: The terraform-provider-ec_v0.4.1 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
The text was updated successfully, but these errors were encountered: