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

Crash when creating api_key #106

Open
michalbogacz opened this issue Oct 5, 2021 · 4 comments
Open

Crash when creating api_key #106

michalbogacz opened this issue Oct 5, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@michalbogacz
Copy link

I tried to create API Key for Schema Registry using Service Account.

...
resource "confluentcloud_service_account" "service_account" {
  name        = local.service-account-name
  description = "default service_account"
}

resource "confluentcloud_api_key" "kafka_schema_registry_api_key" {
  cluster_id     = confluentcloud_schema_registry.schema_registry.id
  environment_id = confluentcloud_environment.env.id
  description    = "Service Account Schema Registry API Key"
  user_id        = confluentcloud_service_account.service_account.id
}

I expected similar result as doing ccloud api-key create --service-account {sa-...} --resource {lsrc-..}

But after apply, I got error:

confluentcloud_api_key.kafka_schema_registry_api_key: Still creating... [10s elapsed]
╷
│ Error: Plugin did not respond
│ 
│   with confluentcloud_api_key.kafka_schema_registry_api_key,
│   on kafka.tf line 36, in resource "confluentcloud_api_key" "kafka_schema_registry_api_key":
│   36: resource "confluentcloud_api_key" "kafka_schema_registry_api_key" {
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵

Stack trace from the terraform-provider-confluentcloud_v0.0.12 plugin:

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

goroutine 14 [running]:
github.com/Mongey/terraform-provider-confluentcloud/ccloud.clusterReady.func1(0xc000299ee0, 0xc000299ea0, 0x0, 0x0, 0x2, 0x1)
        /home/runner/work/terraform-provider-confluentcloud/terraform-provider-confluentcloud/ccloud/resource_kafka_cluster.go:200 +0xc8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext.func1(0xc000458900, 0xc000124460, 0xc0000412c0, 0xc0005ccf00, 0xc0001ae7b8, 0xc0001ae7b0)
        /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/resource/state.go:110 +0x2e9
created by github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext
        /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/resource/state.go:83 +0x1c6

Error: The terraform-provider-confluentcloud_v0.0.12 plugin crashed!
@Matt-S6
Copy link

Matt-S6 commented Oct 29, 2021

@michalbogacz what was your work-around for this? Are schema registry api keys not yet supported?

@Mongey Mongey added the bug Something isn't working label Oct 30, 2021
@michalbogacz
Copy link
Author

@Matt-S6 I didn't found work-around

@Brianbrifri
Copy link

resource "confluentcloud_api_key" "schema_registry_api_key" {
  logical_clusters = [
    var.schema_registry_id
  ]
  environment_id = var.environment_id
  description    = "Schema Registry API Key for domain ${var.domain}"
  user_id        = confluentcloud_service_account.service_account.id

  depends_on = [confluentcloud_service_account.service_account]
}

This is what worked for me.

@samjpv
Copy link

samjpv commented Mar 21, 2022

The exact same thing occurs when trying to create a KSQL cluster api key the standard way. I didn't expect it to work given that this provider supports no KSQL-related resources, but it would be helpful to have a more informative error on failure.

Unfortunately, the workaround above gave me the same error as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants