terraform-provider-huaweicloud
terraform-provider-huaweicloud copied to clipboard
[Opengauss] The opengauss database does not support two replicas
Hi team,
Terraform opengauss resource and data source only supports three replicas, but some regions support two replicas.
The logic of the dn number of huaweicloud_gaussdb_opengauss_instance
is hard-coded and fixed to divide by 3.
So, the two replicas of the opengauss database will throw a panic when getting instance information.
Stack trace from the terraform-provider-huaweicloud_v1.31.1 plugin:
panic: runtime error: integer divide by zero
goroutine 45 [running]:
github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud.dataSourceOpenGaussInstanceRead(0xc000d3f700, 0x17d6780, 0xc000790b60, 0x22ad030, 0xc000080000)
github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/data_source_huaweicloud_gaussdb_opengauss_instance.go:313 +0x1f9c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0005c29a0, 0x1a3ccc8, 0xc000275a80, 0xc000d3f700, 0x17d6780, 0xc000790b60, 0x0, 0x0, 0x0)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:335 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0005c29a0, 0x1a3ccc8, 0xc000275a80, 0xc0010e4c60, 0x17d6780, 0xc000790b60, 0xc000790b60, 0xc0010e4c60, 0x0, 0x0)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:558 +0xfd
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc00000c150, 0x1a3ccc8, 0xc000275a80, 0xc0010e48c0, 0xc000275a80, 0x40b965, 0x16d2420)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1105 +0x4d6
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadDataSource(0xc000e38660, 0x1a3cd70, 0xc000275a80, 0xc000900eb0, 0xc000e38660, 0xc000923530, 0xc000e57ba0)
github.com/hashicorp/[email protected]/tfprotov5/server/server.go:247 +0xe5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler(0x175f5a0, 0xc000e38660, 0x1a3cd70, 0xc000923530, 0xc0002f92c0, 0x0, 0x1a3cd70, 0xc000923530, 0xc0001229a0, 0x157)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:416 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000ade1c0, 0x1a49198, 0xc000292900, 0xc000906600, 0xc000c429c0, 0x226acd0, 0x0, 0x0, 0x0)
google.golang.org/[email protected]/server.go:1194 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc000ade1c0, 0x1a49198, 0xc000292900, 0xc000906600, 0x0)
google.golang.org/[email protected]/server.go:1517 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc0008fc200, 0xc000ade1c0, 0x1a49198, 0xc000292900, 0xc000906600)
google.golang.org/[email protected]/server.go:859 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:857 +0x1fd
Error: The terraform-provider-huaweicloud_v1.31.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.