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

fatal error: concurrent map read and map write (succeeded on retrying apply) #28274

Open
1 task done
joobisb opened this issue Dec 13, 2024 · 1 comment · May be fixed by #28330
Open
1 task done

fatal error: concurrent map read and map write (succeeded on retrying apply) #28274

joobisb opened this issue Dec 13, 2024 · 1 comment · May be fixed by #28330

Comments

@joobisb
Copy link

joobisb commented Dec 13, 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.7.4

AzureRM Provider Version

3.103.1

Affected Resource(s)/Data Source(s)

azurerm_ key_vault

Terraform Configuration Files

module "service" {
  source   = "./modules/azure-key-vault"
  location = var.azure_location
  name     = "service-1"

  resource_group_name = var.resource_group_name
  principal_id        = var.vault_access_principal
  namespace           = var.namespace
}

We have multiple modules like above which creates an AKV vault and also the secrets associated with it.

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
    }
  }
}

data "azurerm_client_config" "current" {}

data "azurerm_subscription" "primary" {}

resource "azurerm_key_vault" "vault" {
  name                        = "${substr(var.name, 0, 17)}-${var.environment}"
  location                    = var.location
  resource_group_name         = var.resource_group_name
  enabled_for_disk_encryption = true
  tenant_id                   = data.azurerm_client_config.current.tenant_id
  soft_delete_retention_days  = 7
  purge_protection_enabled    = false

  sku_name = "standard"

  enable_rbac_authorization = true

  tags = {
    service   = var.name
    namespace = var.namespace
  }
}

resource "azurerm_role_assignment" "reader" {
  scope                = azurerm_key_vault.vault.id
  role_definition_name = "Key Vault Reader"
  principal_id         = var.principal_id
}

resource "azurerm_role_assignment" "user" {
  scope                = azurerm_key_vault.vault.id
  role_definition_name = "Key Vault Secrets User"
  principal_id         = var.principal_id
}

resource "azurerm_role_assignment" "admins" {
  scope                = azurerm_key_vault.vault.id
  role_definition_name = "Admin"
  principal_id         =  <principal_id>
}

resource "azurerm_role_assignment" "service_reader" {
  scope                = azurerm_key_vault.vault.id
  role_definition_name = "Service User"
  principal_id         = <principal_id>

output "vault_name" {
  value = azurerm_key_vault.vault.name
}


### Debug Output/Panic Output

```shell
https://gist.github.com/joobisb/5cda4cee3336cc2ed21ba3c5ef145ed1

Expected Behaviour

No response

Actual Behaviour

I was running terraform apply and the process suddenly crashed with the given stack trace. Though I was able to complete the run on retry, thought of reporting this!

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@wuxu92
Copy link
Contributor

wuxu92 commented Dec 16, 2024

Hi @joobisb,

Thank you for reporting this. It's a known issue and is on my list to fix. I may submit a PR to address this in later versions. (Apologies for linking the wrong PR to this issue.)

@wuxu92 wuxu92 linked a pull request Dec 18, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants