-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Hi,
Cluster version: 25.3.6
TF Provider version: 1.3.1
I have attempted to create users and roles in a clickhouse cluster and here are my results:
I then tried to import them but ended having the same errors.
Role creation
resource "clickhousedbops_role" "my_role" {
name = "my_role"
cluster_name = "staging"
}
Resulted in:
╷
│ Error: Request cancelled
│
│ The plugin6.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵
Stack trace from the terraform-provider-clickhousedbops_v1.3.1 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe32fa2]
goroutine 74 [running]:
github.com/ClickHouse/terraform-provider-clickhousedbops/pkg/resource/role.(*Resource).Create(0xc000619390, {0x12b90d8, 0xc0005110b0}, {{{{0x12c0550, 0xc000511800}, {0xf453a0, 0xc000511710}}, {0x12c6318, 0xc0000c6be0}}, {{{0x12c0550, ...}, ...}, ...}, ...}, ...)
github.com/ClickHouse/terraform-provider-clickhousedbops/pkg/resource/role/role.go:127 +0x2a2
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).CreateResource(0xc0000f7b88, {0x12b90d8, 0xc0005110b0}, 0xc0006134b8, 0xc000613488)
github.com/hashicorp/terraform-plugin-framework@v1.15.1/internal/fwserver/server_createresource.go:127 +0x88e
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ApplyResourceChange(0xc0000f7b88, {0x12b90d8, 0xc0005110b0}, 0xc00025c690, 0xc0006135e0)
github.com/hashicorp/terraform-plugin-framework@v1.15.1/internal/fwserver/server_applyresourcechange.go:63 +0x586
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ApplyResourceChange(0xc0000f7b88, {0x12b90d8?, 0xc000510fc0?}, 0xc0000c7ae0)
github.com/hashicorp/terraform-plugin-framework@v1.15.1/internal/proto6server/server_applyresourcechange.go:71 +0x592
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0xc0002628c0, {0x12b90d8?, 0xc000510570?}, 0xc0001b2080)
github.com/hashicorp/terraform-plugin-go@v0.28.0/tfprotov6/tf6server/server.go:941 +0x3bc
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x109d280, 0xc0002628c0}, {0x12b90d8, 0xc000510570}, 0xc0001b2000, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.28.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:687 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00025a200, {0x12b90d8, 0xc0005104e0}, 0xc0003e6600, 0xc0003575c0, 0x1ab6cc8, 0x0)
google.golang.org/grpc@v1.72.1/server.go:1405 +0x103b
google.golang.org/grpc.(*Server).handleStream(0xc00025a200, {0x12b9cc0, 0xc0003f8000}, 0xc0003e6600)
google.golang.org/grpc@v1.72.1/server.go:1815 +0xbaa
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/grpc@v1.72.1/server.go:1035 +0x7f
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 22
google.golang.org/grpc@v1.72.1/server.go:1046 +0x125
Error: The terraform-provider-clickhousedbops_v1.3.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.
User creation
resource "clickhousedbops_user" "my_user" {
name = "my_user"
cluster_name = "staging"
password_sha256_hash_wo = sha256("password")
password_sha256_hash_wo_version = 1
}
Resulted in:
╷
│ Error: Error Creating ClickHouse User
│
│ with clickhousedbops_user.my_user,
│ on my_user.tf line 3, in resource "clickhousedbops_user" "my_user":
│ 3: resource "clickhousedbops_user" "my_user" {
│
│ code: 376, message: Cannot parse uuid : while converting '' to UUID
│ error executing query
│ error running query
│
╵
Grants
resource "clickhousedbops_grant_privilege" "my_role" {
for_each = {for privilege in ["CREATE","CLUSTER"]: privilege => privilege}
privilege_name = each.value
cluster_name = "staging"
database_name = each.value != "CLUSTER" ? "my_db_*": null
grantee_role_name = "my_role"
}
╷
│ Error: Error Creating ClickHouse Privilege Grant
│
│ with clickhousedbops_grant_privilege.my_role["CREATE"],
│ on my_role.tf line 7, in resource "clickhousedbops_grant_privilege" "my_role":
│ 7: resource "clickhousedbops_grant_privilege" "my_role" {
│
│ The grant operation was successful but it didn't create the expected entry in system.grants table. This normally means there is an already granted privilege to the same grantee that already
│ includes the one you tried to apply.
╵
╷
│ Error: Error Creating ClickHouse Privilege Grant
│
│ with clickhousedbops_grant_privilege.my_role["CLUSTER"],
│ on my_role.tf line 7, in resource "clickhousedbops_grant_privilege" "my_role":
│ 7: resource "clickhousedbops_grant_privilege" "my_role" {
│
│ The grant operation was successful but it didn't create the expected entry in system.grants table. This normally means there is an already granted privilege to the same grantee that already
│ includes the one you tried to apply.