hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.52k stars 4.6k forks source link

azurerm_backup_protected_file_share Error: waiting for Recovery Service Protection Container operation #17640

Open mpjtaylor opened 2 years ago

mpjtaylor commented 2 years ago

Is there an existing issue for this?

Community Note

Terraform Version

1.2.1

AzureRM Provider Version

3.13.0

Affected Resource(s)/Data Source(s)

azurerm_backup_protected_file_share

Terraform Configuration Files

resource "azurerm_storage_share" "filesupport" {
  count                = local.backup == 1 && var.os_type == "Linux" ? 1 : 0
  name                 = local.vm_name
  quota                = var.file_share_quota
  storage_account_name = data.azurerm_storage_account.filesupport[0].name
}

resource "azurerm_storage_share_file" "filesupport" {
  count            = local.backup == 1 && var.os_type == "Linux" ? 1 : 0
  name             = "readme.txt"
  source           = "${path.module}/readme.txt"
  storage_share_id = azurerm_storage_share.filesupport[0].id
}
resource "azurerm_backup_protected_file_share" "filesupport" {
  count                     = local.backup == 1 && var.os_type == "Linux" ? 1 : 0
  source_file_share_name    = local.vm_name
  resource_group_name       = var.support_resource_group
  recovery_vault_name       = data.azurerm_recovery_services_vault.filevault[0].name
  source_storage_account_id = data.azurerm_storage_account.filesupport[0].id
  backup_policy_id          = data.azurerm_backup_policy_file_share.filepolicy[0].id
}

Debug Output/Panic Output

Error: waiting for Recovery Service Protection Container operation "174909b6-e978-483c-a5be-1b2b6faad4f2" (Vault "myvault" in Resource Group "mygroup"): making Read request on Recovery Service Protection Container operation "174909b6-e978-483c-a5be-1b2b6faad4f2" (Vault "myvault" in Resource Group "mygroup"): backup.ProtectionContainerOperationResultsClient#Get: Failure responding to request: StatusCode=500 -- Original Error: autorest/azure: Service returned an error. Status=500 Code="Unknown" Message="Unknown service error" Details=[{"error":{"code":"SyncInquiryDataToSubscriberFailed","message":""}}]
with module.terraform-azure-vm_linux["007"].azurerm_backup_protected_file_share.filesupport[0]
on .terraform/modules/terraform-azure-vm_linux/fileshare.tf line 14, in resource "azurerm_backup_protected_file_share" "filesupport":
resource "azurerm_backup_protected_file_share" "filesupport" {

Error: [ERROR] fileshare 'myshare' not found in protectable or protected fileshares, make sure Storage Account "mystorage" is registered with Recovery Service Vault "myvault" (Resource Group "mygroup")
with module.terraform-azure-vm_linux["006"].azurerm_backup_protected_file_share.filesupport[0]
on .terraform/modules/terraform-azure-vm_linux/fileshare.tf line 14, in resource "azurerm_backup_protected_file_share" "filesupport":
resource "azurerm_backup_protected_file_share" "filesupport" {

Expected Behaviour

File share should be added to the vault, seems this is an issue when processing multiple a rerun fixes this

Actual Behaviour

file share was not added to the vault

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

Yagya-omnius commented 1 year ago

+1

Jeishan-omnius commented 1 year ago

Any luck with this issue @mpjtaylor

mpjtaylor commented 1 year ago

Discussing this with Microsoft still, no progress

mklimek commented 2 weeks ago

It's still there in end of August 2024.

Terraform: 1.8.5 azurerm: 3.108.0