terraform-provider-elasticsearch: "Plugin did not respond" error during applying opendistro_role
Hello! Thank you for your provider, it is really convenient and helpful!
Unfortunately I faced multiple issues with it, the most frustrating is “Plugin did not respond”.
Terraform v1.1.4
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v3.74.1
+ provider registry.terraform.io/hashicorp/http v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.0.0
+ provider registry.terraform.io/hashicorp/random v3.0.1
+ provider registry.terraform.io/phillbaker/elasticsearch v2.0.0-beta.4
Here is my tf-code example:
provider "elasticsearch" {
url = "https://search-{{ ES DNS NAME }}.eu-west-1.es.amazonaws.com"
aws_assume_role_arn = module.es.es_admin_role_arn
healthcheck = false
}
...
resource "elasticsearch_opendistro_role" "this" {
role_name = var.role_name
description = var.issue
cluster_permissions = ["cluster_composite_ops"]
index_permissions {
index_patterns = var.index_patterns
allowed_actions = ["unlimited"]
}
}
resource "elasticsearch_opendistro_user" "this" {
username = var.user_name
password = local.user_password
lifecycle {
ignore_changes = [password]
}
}
And here is the error example(I’m getting multiple errors with different roles/users):
╷
│ Error: Plugin did not respond
│
│ with module.opendistro_groups["{{ GROUP NAME }}"].elasticsearch_opendistro_user.this,
│ on ../modules/opendistro/main.tf line 29, in resource "elasticsearch_opendistro_user" "this":
│ 29: resource "elasticsearch_opendistro_user" "this" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
╵
Stack trace from the terraform-provider-elasticsearch_v2.0.0-beta.4 plugin:
panic: set item just set doesn't exist
goroutine 225 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setSet(0xc000cb2858, 0xc000b5fe10, 0x1, 0x1, 0x1d28640, 0xc000cb28a0, 0xc000561e00, 0x1f627dd, 0xc000b8a3c0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.0/helper/schema/field_writer_map.go:328 +0xc65
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).set(0xc000cb2858, 0xc000b5fe10, 0x1, 0x1, 0x1d28640, 0xc000cb28a0, 0x1, 0x1)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.0/helper/schema/field_writer_map.go:107 +0x250
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).WriteField(0xc000cb2858, 0xc000b5fe10, 0x1, 0x1, 0x1d28640, 0xc000cb28a0, 0x0, 0x0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.0/helper/schema/field_writer_map.go:89 +0x3f9
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc0005c9c80, 0x1f627dd, 0x12, 0x1d28640, 0xc000cb28a0, 0x1, 0x0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.0/helper/schema/resource_data.go:227 +0x1df
github.com/phillbaker/terraform-provider-elasticsearch/es.resourceElasticsearchOpenDistroRoleRead(0xc0005c9c80, 0x1d01580, 0xc0005be780, 0x28e9c20, 0xc000400480)
github.com/phillbaker/terraform-provider-elasticsearch/es/resource_elasticsearch_opendistro_role.go:158 +0x58a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0001935c0, 0x21614a8, 0xc0002f96c0, 0xc0005c9c80, 0x1d01580, 0xc0005be780, 0x0, 0x0, 0x0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.0/helper/schema/resource.go:290 +0x88
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0001935c0, 0x21614a8, 0xc0002f96c0, 0xc000388d90, 0x1d01580, 0xc0005be780, 0xc000514598, 0x0, 0x0, 0x0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.0/helper/schema/resource.go:564 +0x1cb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc00000c510, 0x21614a8, 0xc0002f96c0, 0xc0002f9700, 0xc0002f96c0, 0x100b665, 0x1e700a0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.0/helper/schema/grpc_provider.go:575 +0x43b
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadResource(0xc000331980, 0x2161550, 0xc0002f96c0, 0xc00007ff80, 0xc000331980, 0xc000291740, 0xc000256ba0)
github.com/hashicorp/terraform-plugin-go@v0.1.0/tfprotov5/server/server.go:297 +0x105
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler(0x1ebf100, 0xc000331980, 0x2161550, 0xc000291740, 0xc00007ff20, 0x0, 0x2161550, 0xc000291740, 0xc000ab5560, 0x120)
github.com/hashicorp/terraform-plugin-go@v0.1.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:344 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001ff880, 0x216cfd8, 0xc000402900, 0xc00032d700, 0xc00069b170, 0x28abbd0, 0x0, 0x0, 0x0)
google.golang.org/grpc@v1.33.2/server.go:1210 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc0001ff880, 0x216cfd8, 0xc000402900, 0xc00032d700, 0x0)
google.golang.org/grpc@v1.33.2/server.go:1533 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc0000386d0, 0xc0001ff880, 0x216cfd8, 0xc000402900, 0xc00032d700)
google.golang.org/grpc@v1.33.2/server.go:871 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.33.2/server.go:869 +0x1fd
Error: The terraform-provider-elasticsearch_v2.0.0-beta.4 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.
A couple of things from debug log: https://gist.github.com/sergkondr/c88848f7219ac7b72e0bf62854bed97c
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 43 (13 by maintainers)
@sergkondr a minimal, self contained example that reproduces this bug is still missing. For example, a public repo with example terraform files that reproduce this bug. If you can work on providing that, it would be very helpful.