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

unable to destroy azurerm_backup_protected_vm #20153

Closed
1 task done
Netkracker opened this issue Jan 23, 2023 · 2 comments
Closed
1 task done

unable to destroy azurerm_backup_protected_vm #20153

Netkracker opened this issue Jan 23, 2023 · 2 comments
Labels
bug service/recovery-services upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR v/3.x

Comments

@Netkracker
Copy link
Contributor

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 "+1" or "me too" comments, 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

Terraform Version

1.3.3

AzureRM Provider Version

3.37.0

Affected Resource(s)/Data Source(s)

azurerm_backup_protected_vm

Terraform Configuration Files

**error logs and configuration names don't match because the error was logged using modules. Issue can be reproduced using the configuration files example.**

vault.tf
--------------------------
resource "azurerm_resource_group" "rg_Backup" {
  name     = "rg-backup"
  location = "SwitzerlandNorth"
}

resource "azurerm_recovery_services_vault" "rsv_Workload_VM" {
  name                = "Workload-VM"
  location            = azurerm_resource_group.rg_Backup.location
  resource_group_name = azurerm_resource_group.rg_Backup.name
  sku                 = "Standard"
  storage_mode_type   = "LocallyRedundant"
}

resource "azurerm_recovery_services_vault" "test" {
  name                         = "test"
  location                     = azurerm_resource_group.rg_Backup.location
  resource_group_name          = azurerm_resource_group.rg_Backup.name
  sku                          = "Standard"
  storage_mode_type            = "ZoneRedundant"
  soft_delete_enabled          = "true"
  cross_region_restore_enabled = false

  identity {
    type = "SystemAssigned"
  }

}

resource "azurerm_backup_policy_vm" "vm_backup_policy_fs1" {
  name                           = "test1-dr4w"
  resource_group_name            = azurerm_resource_group.rg_Backup.name
  recovery_vault_name            = azurerm_recovery_services_vault.test.name
  policy_type                    = "V1"
  instant_restore_retention_days = "5"

  timezone = "W. Europe Standard Time"

  backup {
    frequency = "Daily"
    time      = "06:00"
  }

  retention_daily {
    count = "7"
  }

  retention_weekly {
    count    = "1"
    weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
  }
}



resource "azurerm_backup_protected_vm" "vm_backup" {
  resource_group_name = azurerm_resource_group.rg_Backup.name
  recovery_vault_name = azurerm_recovery_services_vault.test.name
  backup_policy_id    = azurerm_backup_policy_vm.vm_backup_policy_fs1.id
  source_vm_id        = azurerm_windows_virtual_machine.vm.id

  depends_on = [
    azurerm_windows_virtual_machine.vm
  ]
}
--------------------------
vm.tf
--------------------------

resource "random_password" "password" {
  length           = 16
  special          = true
  min_special      = 2
  override_special = "*!@#?"
}

resource "azurerm_network_interface" "nic" {

  name                = "test"
  location            = "SwitzerlandNorth"
  resource_group_name = azurerm_resource_group.rg_Backup.name

  ip_configuration {
    name                          = "internal"
    subnet_id                     = data.azurerm_subnet.spoke.id
    private_ip_address_allocation = "Dynamic"
  }
}

# acutal creation of VM
resource "azurerm_windows_virtual_machine" "vm" {
  name                     = "test"
  computer_name            = "test"
  location                 = "SwitzerlandNorth"
  resource_group_name      = azurerm_resource_group.rg_Backup.name
  network_interface_ids    = [azurerm_network_interface.nic.id]
  size                     = "Standard_F2s"
  license_type             = "Windows_Client"
  max_bid_price            = "-1"
  admin_username           = "msbob"
  admin_password           = random_password.password.result
  patch_mode               = "Manual"
  enable_automatic_updates = "false"
  provision_vm_agent       = "true"
  timezone                 = "W. Europe Standard Time"
  priority                 = "Regular"


  os_disk {
    name                 = "osdisk-test"
    disk_size_gb         = "180"
    storage_account_type = "Standard_LRS"
    caching              = "ReadWrite"
  }

  source_image_reference {
    publisher = "MicrosoftWindowsServer"
    offer     = "WindowsServer"
    sku       = "2016-Datacenter"
    version   = "latest"
  }

}
--------------------------
data.tf
--------------------------
data "azurerm_resource_group" "rg" {
  name = "rg-fdtn-network"

}

data "azurerm_virtual_network" "vnet" {
  name                = "vnet-azcm98ln0001"
  resource_group_name = data.azurerm_resource_group.rg.name
}

data "azurerm_subnet" "spoke" {
  name                 = "vnet-spoke-spokesubnet-switzerlandnorth"
  resource_group_name  = data.azurerm_resource_group.rg.name
  virtual_network_name = data.azurerm_virtual_network.vnet.name
}
--------------------------

Debug Output/Panic Output

**error logs  and configuration names don't match because the error was logged using modules. Issue can be reproduced using the configuration files example.**

TestTerraformAzurermExample 2023-01-23T11:27:27+01:00 logger.go:66: │ Error: waiting for the Azure Backup Protection Container "IaasVMContainer;iaasvmcontainerv2;rg-backup-isv6zisw;vazure-7zacqarh" to be deleted (Resource Group "rg-backup-isv6zisw"): making Read request on Azure Backup Protection Container "VM;iaasvmcontainerv2;rg-backup-isv6zisw;vazure-7zacqarh" (Resource Group "rg-backup-isv6zisw"): backup.ProtectionContainersClient#Get: Failure responding to request: StatusCode=500 -- Original Error: autorest/azure: Service returned an error. Status=500 Code="CloudInternalError" Message="Microsoft Azure Backup encountered an internal error. Wait for a few minutes and then try the operation again. If the issue persists, please contact Microsoft support."


2023-01-23T12:35:15.149+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Request: 
GET /subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-9xfbsjn7/protectedItems/VM%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-9xfbsjn7?api-version=2021-12-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-windows) go-autorest/v14.2.1 Azure-SDK-For-Go/v66.0.0 backup/2021-12-01 HashiCorp Terraform/1.3.3 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
Accept-Encoding: gzip: timestamp=2023-01-23T12:35:15.149+0100
2023-01-23T12:35:15.286+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Request: 
GET /subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-exjc3zxb/protectedItems/VM%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-exjc3zxb?api-version=2021-12-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-windows) go-autorest/v14.2.1 Azure-SDK-For-Go/v66.0.0 backup/2021-12-01 HashiCorp Terraform/1.3.3 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
Accept-Encoding: gzip: timestamp=2023-01-23T12:35:15.286+0100
2023-01-23T12:35:15.370+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Response for https://management.azure.com/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-9xfbsjn7/protectedItems/VM%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-9xfbsjn7?api-version=2021-12-01: 
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Mon, 23 Jan 2023 11:35:14 GMT
Expires: -1
Pragma: no-cache
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: 9d9fd1e1-e6dd-43f3-a6a9-7d03a809a5a2
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: 146
X-Ms-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Routing-Request-Id: SWITZERLANDNORTH:20230123T113515Z:355df956-e37f-4460-946f-addaada97d46
X-Powered-By: ASP.NET

{"id":"/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rg-backup-exjc3zxb;vazure-9xfbsjn7/protectedItems/VM;iaasvmcontainerv2;rg-backup-exjc3zxb;vazure-9xfbsjn7","name":"VM;iaasvmcontainerv2;rg-backup-exjc3zxb;vazure-9xfbsjn7","type":"Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems","properties":{"kpisHealths":{},"friendlyName":"vazure-9xfbsjn7","virtualMachineId":"/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.Compute/virtualMachines/vazure-9xfbsjn7","protectionStatus":"Healthy","protectionState":"ProtectionStopped","healthStatus":"Passed","lastBackupStatus":"","lastBackupTime":"2001-01-01T00:00:00Z","protectedItemDataId":"6980913675783911260","ConfiguredRPGenerationFrequency":"00:00:00","protectedItemType":"Microsoft.Compute/virtualMachines","backupManagementType":"AzureIaasVM","workloadType":"VM","containerName":"iaasvmcontainerv2;rg-backup-exjc3zxb;vazure-9xfbsjn7","sourceResourceId":"/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.Compute/virtualMachines/vazure-9xfbsjn7","policyId":"","policyName":"","vaultId":"https://management.azure.com/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg","deferredDeleteTimeInUTC":"2023-01-23T11:34:34.8194612Z","isScheduledForDeferredDelete":true,"deferredDeleteTimeRemaining":"13.23:59:19.5209610","isArchiveEnabled":false,"softDeleteRetentionPeriod":14}}: timestamp=2023-01-23T12:35:15.369+0100
2023-01-23T12:35:15.370+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: Waiting for state to become: [NotFound]: timestamp=2023-01-23T12:35:15.370+0100
2023-01-23T12:35:15.447+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Response for https://management.azure.com/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-exjc3zxb/protectedItems/VM%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-exjc3zxb?api-version=2021-12-01: 
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Mon, 23 Jan 2023 11:35:14 GMT
Expires: -1
Pragma: no-cache
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: ead5ade8-67b1-4d7b-9454-c0c0fc54ae51
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: 146
X-Ms-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Routing-Request-Id: SWITZERLANDNORTH:20230123T113515Z:e343de8b-bb1b-40d5-a662-8e8de46c537c

{"id":"/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rg-backup-exjc3zxb;vazure-exjc3zxb/protectedItems/VM;iaasvmcontainerv2;rg-backup-exjc3zxb;vazure-exjc3zxb","name":"VM;iaasvmcontainerv2;rg-backup-exjc3zxb;vazure-exjc3zxb","type":"Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems","properties":{"kpisHealths":{},"friendlyName":"vazure-exjc3zxb","virtualMachineId":"/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.Compute/virtualMachines/vazure-exjc3zxb","protectionStatus":"Healthy","protectionState":"ProtectionStopped","healthStatus":"Passed","lastBackupStatus":"","lastBackupTime":"2001-01-01T00:00:00Z","protectedItemDataId":"6980913675645183330","ConfiguredRPGenerationFrequency":"00:00:00","protectedItemType":"Microsoft.Compute/virtualMachines","backupManagementType":"AzureIaasVM","workloadType":"VM","containerName":"iaasvmcontainerv2;rg-backup-exjc3zxb;vazure-exjc3zxb","sourceResourceId":"/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.Compute/virtualMachines/vazure-exjc3zxb","policyId":"","policyName":"","vaultId":"https://management.azure.com/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg","deferredDeleteTimeInUTC":"2023-01-23T11:34:34.8848151Z","isScheduledForDeferredDelete":true,"deferredDeleteTimeRemaining":"13.23:59:19.5080102","isArchiveEnabled":false,"softDeleteRetentionPeriod":14}}: timestamp=2023-01-23T12:35:15.447+0100
2023-01-23T12:35:15.447+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: Waiting for state to become: [NotFound]: timestamp=2023-01-23T12:35:15.447+0100
2023-01-23T12:35:25.386+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Request: 
GET /subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-9xfbsjn7?api-version=2021-12-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-windows) go-autorest/v14.2.1 Azure-SDK-For-Go/v66.0.0 backup/2021-12-01 HashiCorp Terraform/1.3.3 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
Accept-Encoding: gzip: timestamp=2023-01-23T12:35:25.386+0100
2023-01-23T12:35:25.451+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Request: 
GET /subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-exjc3zxb?api-version=2021-12-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-windows) go-autorest/v14.2.1 Azure-SDK-For-Go/v66.0.0 backup/2021-12-01 HashiCorp Terraform/1.3.3 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
Accept-Encoding: gzip: timestamp=2023-01-23T12:35:25.451+0100
2023-01-23T12:35:25.982+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Response for https://management.azure.com/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-9xfbsjn7?api-version=2021-12-01: 
HTTP/2.0 500 Internal Server Error
Content-Length: 219
Cache-Control: no-cache
Content-Type: application/json
Date: Mon, 23 Jan 2023 11:35:25 GMT
Expires: -1
Pragma: no-cache
Server: Microsoft-IIS/10.0
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: 2fc4b8be-91b5-410d-a6a7-2db84a937e74
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Failure-Cause: service
X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: 148
X-Ms-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Routing-Request-Id: SWITZERLANDNORTH:20230123T113525Z:0f77cd9e-0c20-408b-8afa-867ff119fcfb

{"error":{"code":"CloudInternalError","message":"Microsoft Azure Backup encountered an internal error. Wait for a few minutes and then try the operation again. If the issue persists, please contact Microsoft support."}}: timestamp=2023-01-23T12:35:25.982+0100
2023-01-23T12:35:26.062+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Response for https://management.azure.com/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-exjc3zxb?api-version=2021-12-01: 
HTTP/2.0 500 Internal Server Error
Content-Length: 219
Cache-Control: no-cache
Content-Type: application/json
Date: Mon, 23 Jan 2023 11:35:25 GMT
Expires: -1
Pragma: no-cache
Server: Microsoft-IIS/10.0
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: 79f4d0fd-685d-4d2e-92be-997de74b1ed7
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Failure-Cause: service
X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: 148
X-Ms-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Routing-Request-Id: SWITZERLANDNORTH:20230123T113526Z:c035d932-b248-40bf-8d9b-b367d001bfda

{"error":{"code":"CloudInternalError","message":"Microsoft Azure Backup encountered an internal error. Wait for a few minutes and then try the operation again. If the issue persists, please contact Microsoft support."}}: timestamp=2023-01-23T12:35:26.062+0100
2023-01-23T12:35:55.985+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Request: 
GET /subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-9xfbsjn7?api-version=2021-12-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-windows) go-autorest/v14.2.1 Azure-SDK-For-Go/v66.0.0 backup/2021-12-01 HashiCorp Terraform/1.3.3 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
Accept-Encoding: gzip: timestamp=2023-01-23T12:35:55.984+0100
2023-01-23T12:35:56.067+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Request: 
GET /subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-exjc3zxb?api-version=2021-12-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-windows) go-autorest/v14.2.1 Azure-SDK-For-Go/v66.0.0 backup/2021-12-01 HashiCorp Terraform/1.3.3 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
Accept-Encoding: gzip: timestamp=2023-01-23T12:35:56.067+0100
2023-01-23T12:35:56.348+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Response for https://management.azure.com/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-exjc3zxb?api-version=2021-12-01: 
HTTP/2.0 500 Internal Server Error
Content-Length: 219
Cache-Control: no-cache
Content-Type: application/json
Date: Mon, 23 Jan 2023 11:35:56 GMT
Expires: -1
Pragma: no-cache
Server: Microsoft-IIS/10.0
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: 9555a105-2054-4b1c-ae43-c9aed7672b41
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Failure-Cause: service
X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: 146
X-Ms-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Routing-Request-Id: SWITZERLANDNORTH:20230123T113556Z:7bd50dd2-b877-4a32-a954-0259adb492d3

{"error":{"code":"CloudInternalError","message":"Microsoft Azure Backup encountered an internal error. Wait for a few minutes and then try the operation again. If the issue persists, please contact Microsoft support."}}: timestamp=2023-01-23T12:35:56.348+0100
2023-01-23T12:35:56.433+0100 [DEBUG] provider.terraform-provider-azurerm_v3.37.0_x5.exe: AzureRM Response for https://management.azure.com/subscriptions/5cdf9d01-a25a-49ae-8e3c-096917cceeb4/resourceGroups/rg-backup-exjc3zxb/providers/Microsoft.RecoveryServices/vaults/rs-vault-vm-m98ln0014-jlg/backupFabrics/Azure/protectionContainers/IaasVMContainer%3Biaasvmcontainerv2%3Brg-backup-exjc3zxb%3Bvazure-9xfbsjn7?api-version=2021-12-01: 
HTTP/2.0 500 Internal Server Error
Content-Length: 219
Cache-Control: no-cache
Content-Type: application/json
Date: Mon, 23 Jan 2023 11:35:56 GMT
Pragma: no-cache
Server: Microsoft-IIS/10.0
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: fa4a411f-45c3-4ec9-82a8-cb58509ec6a6
X-Ms-Client-Request-Id: fa4a411f-45c3-4ec9-82a8-cb58509ec6a6
X-Ms-Correlation-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Failure-Cause: service
X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: 146
X-Ms-Request-Id: 5e6c9aba-f592-e8bd-3df5-c39d881b8ab5
X-Ms-Routing-Request-Id: SWITZERLANDNORTH:20230123T113556Z:59f37dfa-ade4-471a-98fb-ccfe9772fae7
X-Powered-By: ASP.NET

{"error":{"code":"CloudInternalError","message":"Microsoft Azure Backup encountered an internal error. Wait for a few minutes and then try the operation again. If the issue persists, please contact Microsoft support."}}: timestamp=2023-01-23T12:35:56.433+0100

Expected Behaviour

backup protected vm gets removed from state, although the backup protected item is tecnically still present in azure due to soft delete state.

Actual Behaviour

Terraform run times out, ressource gets set to softdelete state inside of azure but terraform state is not upated and tries to remove the backup at next run again.

Steps to Reproduce

terraform destroy

Important Factoids

No response

References

There was an similiar issue that was fixxed in azurerm version 3.8.0
#16939

see:
https://github.com/hashicorp/terraform-provider-azurerm/blob/v3.8.0/CHANGELOG.md

@Netkracker Netkracker added the bug label Jan 23, 2023
@github-actions github-actions bot removed the bug label Jan 23, 2023
@manicminer manicminer added bug upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR service/recovery-services labels Jan 30, 2023
@Netkracker
Copy link
Contributor Author

@github-actions
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 Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug service/recovery-services upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR v/3.x
Projects
None yet
Development

No branches or pull requests

3 participants