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

The terraform-provider-azurerm_v4.1.0_x5 plugin crashed! #27368

Closed
1 task done
zadigus opened this issue Sep 12, 2024 · 2 comments
Closed
1 task done

The terraform-provider-azurerm_v4.1.0_x5 plugin crashed! #27368

zadigus opened this issue Sep 12, 2024 · 2 comments

Comments

@zadigus
Copy link

zadigus commented Sep 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.9.5

AzureRM Provider Version

4.1.0

Affected Resource(s)/Data Source(s)

azurerm_cosmosdb_account, azurerm_key_vault_secret

Terraform Configuration Files

resource "azurerm_cosmosdb_account" "mongodb" {
  name                = var.resource_name
  location            = var.location
  resource_group_name = var.resource_group_name
  offer_type           = "Standard"
  kind                 = "MongoDB"
  minimal_tls_version  = "Tls12"
  mongo_server_version = "4.2"

  access_key_metadata_writes_enabled = false
  public_network_access_enabled      = false

  # disabling this is only supported for SQL API account
  local_authentication_disabled = false

  create_mode = "Default"
  backup {
    type = "Continuous"
    tier = "Continuous30Days"
  }

  capabilities {
    name = "EnableMongo"
  }

  capabilities {
    name = "EnableMongoRoleBasedAccessControl"
  }

  capabilities {
    name = "DisableRateLimitingResponses"
  }

  consistency_policy {
    consistency_level = "Strong"
  }

  automatic_failover_enabled = length(var.geo_replication) > 0

  geo_location {
    location          = var.location
    failover_priority = 0
    zone_redundant    = true
  }

  dynamic "geo_location" {
    for_each = var.geo_replication
    content {
      location          = geo_location.value
      failover_priority = 1
      zone_redundant    = true
    }
  }

  capacity {
    total_throughput_limit = var.max_throughput
  }
}

resource "random_password" "user-passwords" {
  for_each = var.roles

  length           = 32
  special          = true
  override_special = "_%@"
}

resource "azurerm_key_vault_secret" "quota-mgmt" {
  for_each = var.roles

  name         = "mongodb-${each.key}"
  key_vault_id = var.vault_id
  value        = random_password.user-passwords[each.key].result

  lifecycle {
    ignore_changes = [
      value,
    ]
  }
}

Debug Output/Panic Output

│ Error: Request cancelled
05:36:19   │ 
05:36:19   │   with module.mongodb.azurerm_cosmosdb_account.mongodb,
05:36:19   │   on ../../modules/global/mongodb/main.tf line 3, in resource "azurerm_cosmosdb_account" "mongodb":
05:36:19   │    3: resource "azurerm_cosmosdb_account" "mongodb" {
05:36:19   │ 
05:36:19   │ The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.
05:36:19   ╵
05:36:19   ╷
05:36:19   │ Error: Request cancelled
05:36:19   │ 
05:36:19   │   with module.mongodb.azurerm_key_vault_secret.<secret-name>["<name>"],
05:36:19   │   on ../../modules/global/mongodb/main.tf line 123, in resource "azurerm_key_vault_secret" "<name>":
05:36:19   │  123: resource "azurerm_key_vault_secret" "<name>" {
05:36:19   │ 
05:36:19   │ The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.
05:36:19   ╵
05:36:19   ╷
05:36:19   │ Error: Request cancelled
05:36:19   │ 
05:36:19   │   with module.mongodb.azurerm_key_vault_secret.<secret-name>["<other-name>"],
05:36:19   │   on ../../modules/global/mongodb/main.tf line 123, in resource "azurerm_key_vault_secret" "<secret-name>":
05:36:19   │  123: resource "azurerm_key_vault_secret" "<secret-name>" {
05:36:19   │ 
05:36:19   │ The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.
05:36:19   ╵
05:36:19   ╷
05:36:19   │ Error: Request cancelled
05:36:19   │ 
05:36:19   │   with module.mongodb.azurerm_key_vault_secret.<secret-name>[<name>"],
05:36:19   │   on ../../modules/global/mongodb/main.tf line 123, in resource "azurerm_key_vault_secret" "<secret-name>":
05:36:19   │  123: resource "azurerm_key_vault_secret" "<secret-name>" {
05:36:19   │ 
05:36:19   │ The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.
05:36:19   ╵
05:36:19   ╷
05:36:19   │ Error: Request cancelled
05:36:19   │ 
05:36:19   │   with module.vault-secrets.azurerm_key_vault_secret.<secret-name>,
05:36:19   │   on ../../modules/global/vault-secrets/main.tf line 1, in resource "azurerm_key_vault_secret" "<secret-name>":
05:36:19   │    1: resource "azurerm_key_vault_secret" "<secret-name>" {
05:36:19   │ 
05:36:19   │ The plugin.(*GRPCProvider).ReadResource request was cancelled.
05:36:19   ╵
05:36:19   ╷
05:36:19   │ Error: Plugin did not respond
05:36:19   │ 
05:36:19   │   with module.vault-secrets.azurerm_key_vault_secret.auth0-user-management-app-client-secret-key,
05:36:19   │   on ../../modules/global/vault-secrets/main.tf line 9, in resource "azurerm_key_vault_secret" "<secret-name>":
05:36:19   │    9: resource "azurerm_key_vault_secret" "<secret-name>" {
05:36:19   │ 
05:36:19   │ The plugin encountered an error, and failed to respond to the
05:36:19   │ plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more
05:36:19   │ details.
05:36:19   ╵
05:36:19   
05:36:19   Stack trace from the terraform-provider-azurerm_v4.1.0_x5 plugin:
05:36:19   
05:36:19   panic: interface conversion: interface {} is []interface {}, not string
05:36:19   
05:36:19   goroutine 591 [running]:
05:36:19   github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/migration.(*CosmosDBAccountV0toV1).UpgradeFunc.CosmosDBAccountV0toV1.UpgradeFunc.func1({0x0?, 0x0?}, 0x0?, {0x0?, 0x0?})
05:36:19     github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/migration/cosmosdb_account.go:560 +0xf0
05:36:19   github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk.StateUpgrades.func1({0x8b0c578, 0xc000f293b0}, 0x0?, {0x729e040, 0xc0022fcd80})
05:36:19     github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk/state_upgrades.go:55 +0x5e
05:36:19   github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).upgradeJSONState(0xc0008fd950, {0x8b0c578, 0xc000f293b0}, 0xd?, 0x832002a?, 0x14?)
05:36:19     github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:491 +0x75
05:36:19   github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).UpgradeResourceState(0xc0008fd950, {0x8b0c578?, 0xc000f29140?}, 0xc0024d76c0)
05:36:19     github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:367 +0x3fa
05:36:19   github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).UpgradeResourceState(0x8b0c5b0?, {0x8b0c578?, 0xc0018a7d70?}, 0xc0024d76c0)
05:36:19     github.com/hashicorp/[email protected]/tf5muxserver/mux_server_UpgradeResourceState.go:36 +0x1a2
05:36:19   github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).UpgradeResourceState(0xc0013fdb80, {0x8b0c578?, 0xc0018a70e0?}, 0xc001a9e8c0)
05:36:19     github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:750 +0x27b
05:36:19   github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_UpgradeResourceState_Handler({0x7fbde60?, 0xc0013fdb80}, {0x8b0c578, 0xc0018a70e0}, 0xc0040b8f80, 0x0)
05:36:19     github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:446 +0x16c
05:36:19   google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001bf000, {0x8b0c578, 0xc0018a7050}, {0x8b38f60, 0xc0001d2180}, 0xc0030ee900, 0xc000f50f00, 0xe173738, 0x0)
05:36:19     google.golang.org/[email protected]/server.go:1369 +0xe23
05:36:19   google.golang.org/grpc.(*Server).handleStream(0xc0001bf000, {0x8b38f60, 0xc0001d2180}, 0xc0030ee900)
05:36:19     google.golang.org/[email protected]/server.go:1780 +0x1016
05:36:19   google.golang.org/grpc.(*Server).serveStreams.func2.1()
05:36:19     google.golang.org/[email protected]/server.go:1019 +0x8b
05:36:19   created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 28
05:36:19     google.golang.org/[email protected]/server.go:1030 +0x135
05:36:19   
05:36:19   Error: The terraform-provider-azurerm_v4.1.0_x5 plugin crashed!
05:36:19   
05:36:19   This is always indicative of a bug within the plugin. It would be immensely
05:36:19   helpful if you could report the crash with the plugin's maintainers so that it
05:36:19   can be fixed. The output above should help diagnose the issue.

Expected Behaviour

Should have no error.

Actual Behaviour

The plugin is crashing.

I am not entirely sure which resource exactly is producing the error, currently when I run the terraform apply -destroy I get errors for mongodb and keyvault secret.

Steps to Reproduce

terraform apply -destroy -auto-approve

Important Factoids

No response

References

No response

@teowa
Copy link
Contributor

teowa commented Sep 12, 2024

Hi @zadigus this has been resolved in #27302, which will release in 4.2.0.
You can workaround the issue by terraform state rm followed by terraform import the azurerm_cosmosdb_account resources.
thanks.

@zadigus zadigus closed this as completed Sep 12, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants