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.48k stars 4.56k forks source link

Intermitent InternalServerError Issue creating nsg flow logs #13703

Closed mariussm closed 2 years ago

mariussm commented 2 years ago

Community Note

Terraform (and AzureRM Provider) Version

Terraform 1.0.4 AzureRM 2.80.0

Affected Resource(s)

azurerm_network_watcher_flow_log

Terraform Configuration Files

resource "azurerm_network_watcher_flow_log" "flowlog" {
  count = length(var.nsgIds)

  network_watcher_name = var.networkWatcherName
  resource_group_name  = var.resourceGroupName

  network_security_group_id = var.nsgIds[count.index]
  storage_account_id        = var.storageAccountId
  enabled                   = true

  retention_policy {
    enabled = true
    days    = var.retentionInDays
  }

  traffic_analytics {
    enabled               = true
    workspace_id          = var.logAnalyticsWorkspaceId
    workspace_region      = var.logAnalyticsWorkspaceRegion
    workspace_resource_id = var.logAnalyticsWorkspaceResourceId
    interval_in_minutes   = var.trafficAnalyticsInterval
  }

}

Debug Output

module.flowlogs.azurerm_network_watcher_flow_log.flowlog[0]: Still creating... [6m10s elapsed] module.flowlogs.azurerm_network_watcher_flow_log.flowlog[0]: Still creating... [6m20s elapsed] ╷ │ Error: waiting for completion of creating "Flow Log: (Name \"Microsoft.Networkxxxxxxx\" / Network Watcher Name \"xxxxxxxx\" / Resource Group \"xxxxxxxxxxx\")": Code="InternalServerError" Message="An error occurred." Details=[] │ │ with module.flowlogs.azurerm_network_watcher_flow_log.flowlog[0], │ on ../modules/flowlogs/main.tf line 60, in resource "azurerm_network_watcher_flow_log" "flowlog": │ 60: resource "azurerm_network_watcher_flow_log" "flowlog" { │ ╵

Panic Output

Expected Behaviour

Able to create flow logs

Actual Behaviour

Some times unable to create NSG flow logs, some times not.

Steps to Reproduce

bardholthe commented 2 years ago

The issue has been resolved after MS Case was opened. No error in Azure said MS, but other stuff started to work better as well after case was started. Could be due to the VM outage last week. No change in code but worked this morning without any errors and success in Terraform code. Case can be closed

mariussm commented 2 years ago

Yeah, not configured that there has been changes on Microsoft side, but let's close it until it reappears :)

github-actions[bot] commented 2 years ago

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.