risingwavelabs / terraform-provider-risingwavecloud

Apache License 2.0
0 stars 0 forks source link

Import cluster failed #34

Closed cyliu0 closed 4 months ago

cyliu0 commented 4 months ago

Get the following error while importing a free tier cluster

> terraform import risingwavecloud_cluster.cy-gcp 018e87f2-e81a-7f43-9dc6-5df44dae9691

risingwavecloud_cluster.cy-gcp: Importing from ID "018e87f2-e81a-7f43-9dc6-5df44dae9691"...
risingwavecloud_cluster.cy-gcp: Import prepared!
  Prepared risingwavecloud_cluster for import
risingwavecloud_cluster.cy-gcp: Refreshing state... [id=018e87f2-e81a-7f43-9dc6-5df44dae9691]
╷
│ Warning: API endpoint is provided
│ 
│   with provider["registry.terraform.io/risingwavelabs/risingwavecloud"],
│   on /Users/liuchengyou/working/risingwave-labs/terraform-provider-risingwavecloud/cy/provider.tf line 10, in provider "risingwavecloud":
│   10: provider "risingwavecloud" {
│ 
│ Endpoint is only for internal testing. Current endpoint: https://rls-apse1-acc.risingwave-cloud.xyz/api/v1
╵

╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-risingwavecloud_v0.1.4 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x1051af200]

goroutine 63 [running]:
github.com/risingwavelabs/terraform-provider-risingwavecloud/internal/provider.clusterToDataModel(0x140001a3b00, 0x140001afdd0)
        github.com/risingwavelabs/terraform-provider-risingwavecloud/internal/provider/resource_cluster.go:341 +0x210
github.com/risingwavelabs/terraform-provider-risingwavecloud/internal/provider.(*ClusterResource).Read(0x140003b0d30, {0x10547e728, 0x140003a99b0}, {{{{0x105482970, 0x1400047e270}, {0x10537dc60, 0x1400047e000}}, {0x105483fa0, 0x14000148fa0}}, 0x1400006a4e0, ...}, ...)
        github.com/risingwavelabs/terraform-provider-risingwavecloud/internal/provider/resource_cluster.go:654 +0x25c
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadResource(0x140001ed040, {0x10547e728, 0x140003a99b0}, 0x140003a9a40, 0x140001bd6a0)
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/fwserver/server_readresource.go:101 +0x514
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ReadResource(0x140001ed040, {0x10547e728?, 0x140003a9800?}, 0x1400026e7c0)
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/proto6server/server_readresource.go:55 +0x314
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadResource(0x140001c46e0, {0x10547e728?, 0x140003a8c60?}, 0x140004a43c0)
        github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov6/tf6server/server.go:776 +0x3c4
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadResource_Handler({0x105451aa0?, 0x140001c46e0}, {0x10547e728, 0x140003a8c60}, 0x14000192880, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:482 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x1400018f000, {0x10547e728, 0x140003a8bd0}, {0x105483320, 0x140003a4000}, 0x140003ac360, 0x140002f92f0, 0x10593e528, 0x0)
        google.golang.org/grpc@v1.62.1/server.go:1386 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x1400018f000, {0x105483320, 0x140003a4000}, 0x140003ac360)
        google.golang.org/grpc@v1.62.1/server.go:1797 +0xc70
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/grpc@v1.62.1/server.go:1027 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 16
        google.golang.org/grpc@v1.62.1/server.go:1038 +0x150

Error: The terraform-provider-risingwavecloud_v0.1.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.
resource "risingwavecloud_cluster" "cy-gcp" {
  region  = "us-central1"
  name    = "cy-gcp"
  version = "v1.7.2"
  spec = {
    compute = {
      default_node_group = {
        cpu     = "2"
        memory  = "8 GB"
        replica = 1
      }
    }
    compactor = {
      default_node_group = {
        cpu     = "1"
        memory  = "4 GB"
        replica = 1
      }
    }
    frontend = {
      default_node_group = {
        cpu     = "1"
        memory  = "4 GB"
        replica = 1
      }
    }
    meta = {
      default_node_group = {
        cpu     = "1"
        memory  = "4 GB"
        replica = 1
      }
      etcd_meta_store = {
        default_node_group = {
          cpu     = "1"
          memory  = "4 GB"
          replica = 1
        }
      }
    }
  }
}