Skip to content
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

Datasource rediscloud_database crashes for active-active databases #468

Open
atsui-bay1 opened this issue Feb 2, 2024 · 1 comment
Open

Comments

@atsui-bay1
Copy link

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
1.3.6

Affected Resource(s)

Please list the resources as a list, for example:

  • datasource rediscloud_database

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

data "rediscloud_database" "database" {
  subscription_id = 123
  name            = "my-db"
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

│ Error: Plugin did not respond
│ 
│   with data.rediscloud_database.database["test.vault"],
│   on redis.tf line 12, in data "rediscloud_database" "database":
│   12: data "rediscloud_database" "database" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadDataSource call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-rediscloud_v1.5.0 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x14ec71c]

goroutine 31 [running]:
github.com/RedisLabs/terraform-provider-rediscloud/provider.dataSourceRedisCloudDatabaseRead({0x19df128, 0xc000480300}, 0x0?, {0x1765000?, 0xc000134788})
        github.com/RedisLabs/terraform-provider-rediscloud/provider/datasource_rediscloud_database.go:234 +0xa3c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0000a0460, {0x19df160, 0xc0000fcdb0}, 0xd?, {0x1765000, 0xc000134788})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.28.0/helper/schema/resource.go:795 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0000a0460, {0x19df160, 0xc0000fcdb0}, 0xc0004de400, {0x1765000, 0xc000134788})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.28.0/helper/schema/resource.go:1015 +0x150
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc000012048, {0x19df160?, 0xc0000fcc90?}, 0xc00030c060)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.28.0/helper/schema/grpc_provider.go:1204 +0x38f
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadDataSource(0xc0000034a0, {0x19df160?, 0xc0000fc2d0?}, 0xc0000980f0)
        github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/tf5server/server.go:661 +0x403
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler({0x1875460?, 0xc0000034a0}, {0x19df160, 0xc0000fc2d0}, 0xc0000a4000, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:458 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000456000, {0x19e2ee0, 0xc0000e24e0}, 0xc00015a7e0, 0xc000093c20, 0x1ea7930, 0x0)
        google.golang.org/grpc@v1.56.1/server.go:1337 +0xdf0
google.golang.org/grpc.(*Server).handleStream(0xc000456000, {0x19e2ee0, 0xc0000e24e0}, 0xc00015a7e0, 0x0)
        google.golang.org/grpc@v1.56.1/server.go:1714 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/grpc@v1.56.1/server.go:959 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.56.1/server.go:957 +0x18c

Expected Behavior

Datasource should return the requested database, or a new datasource needs to be created for active-active databases

Actual Behavior

What actually happened?
Crash, due to ThroughputMeasurement.By not existing in the JSON response

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

  • GH-1234
@NoamSternRedis
Copy link
Collaborator

Hi @atsui-bay1, thank you for the feedback and detailed description.
We are investigating it. It seems like, as you mentioned, the database data source doesn't support A.

We will work on this soon and fix it. I'll make sure to keep you posted once we have an ETA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants