SchwarzIT/terraform-provider-stackit

[Secret Manager] Panic when trying to create new secret manager instance.

Closed this issue · 1 comments

Hi,

I am trying to create a secret manager instance and the provider paniced.

This is the resource I am trying to create (following the example from here)

resource "stackit_secrets_manager_instance" "sc-prod" {
  project_id = var.project_id
  name       = "sc-prod"
}

This is the output I am receiving from the terraform apply

terraform apply

stackit_object_storage_bucket.terraform-state: Refreshing state... [id=terraform-state-bucket]
stackit_object_storage_credentials_group.terraform-state-cg: Refreshing state... [id=5b299bc3-955f-4eb6-b982-7ef4f40d57d6]
stackit_object_storage_project.terraform-state: Refreshing state... [id=5a36f6d5-1b80-4f14-ab53-825bd0ee63af]
stackit_object_storage_credential.terraform-state-c: Refreshing state... [id=SGKH08C_V_Qm7GdzC7q_i_2VGPfcR4rg3LKzOEufoA==]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform planned the following actions, but then encountered a problem:

  # stackit_secrets_manager_instance.sc-prod will be created
  + resource "stackit_secrets_manager_instance" "sc-prod" {
      + acl          = (known after apply)
      + api_url      = (known after apply)
      + frontend_url = (known after apply)
      + id           = (known after apply)
      + name         = "sc-prod"
      + project_id   = "5a36f6d5-1b80-4f14-ab53-825bd0ee63af"
    }

Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Error: Request cancelled
│ 
│ The plugin6.(*GRPCProvider).ReadResource request was cancelled.
╵

Stack trace from the terraform-provider-stackit_v1.23.4 plugin:

panic: reflect: call of reflect.Value.FieldByName on zero Value

goroutine 182 [running]:
reflect.flag.mustBe(...)
        reflect/value.go:223
reflect.Value.FieldByName({0x0?, 0x0?, 0xf93620?}, {0xe5abcd?, 0xc000675268?})
        reflect/value.go:1345 +0x1d6
github.com/SchwarzIT/terraform-provider-stackit/stackit/internal/common.Validate(0xc0004c7610?, {0xd22840?, 0x0}, {0xf93620?, 0xc00045cb70?}, {0xc000675268?, 0x0?, 0xc00013bd10?})
        github.com/SchwarzIT/terraform-provider-stackit/stackit/internal/common/helpers.go:105 +0x136
github.com/SchwarzIT/terraform-provider-stackit/stackit/internal/resources/object-storage/credential.Resource.Read({0xc0003ea6e0, {{0xe80f2c, 0x2d}, {0xc00003c580, 0x1e}}}, {0xf98db0, 0xc0005d12f0}, {{{{0xf9d848, 0xc000455230}, {0xd0d840, ...}}, ...}, ...}, ...)
        github.com/SchwarzIT/terraform-provider-stackit/stackit/internal/resources/object-storage/credential/actions.go:91 +0x288
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadResource(0xc00019ba20, {0xf98db0, 0xc0005d12f0}, 0xc0005d1410, 0xc000675648)
        github.com/hashicorp/terraform-plugin-framework@v1.2.0/internal/fwserver/server_readresource.go:97 +0x677
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ReadResource(0xc00019ba20, {0xf98db0?, 0xc0005d11a0?}, 0xc0006301c0)
        github.com/hashicorp/terraform-plugin-framework@v1.2.0/internal/proto6server/server_readresource.go:52 +0x41a
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadResource(0xc0001d8e60, {0xf98db0?, 0xc0005d0180?}, 0xc0007001e0)
        github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov6/tf6server/server.go:746 +0x4b1
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadResource_Handler({0xe24260?, 0xc0001d8e60}, {0xf98db0, 0xc0005d0180}, 0xc00053c4d0, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:383 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001de1e0, {0xf9e078, 0xc0001a3a00}, 0xc0005f3320, 0xc000340660, 0x154a5d0, 0x0)
        google.golang.org/grpc@v1.54.0/server.go:1345 +0xdf3
google.golang.org/grpc.(*Server).handleStream(0xc0001de1e0, {0xf9e078, 0xc0001a3a00}, 0xc0005f3320, 0x0)
        google.golang.org/grpc@v1.54.0/server.go:1722 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.54.0/server.go:966 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.54.0/server.go:964 +0x28a

Error: The terraform-provider-stackit_v1.23.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.