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

kernel panic in windows_web_app auto_heal settings #23739

Closed
1 task done
calebak404 opened this issue Oct 31, 2023 · 2 comments · Fixed by #23812
Closed
1 task done

kernel panic in windows_web_app auto_heal settings #23739

calebak404 opened this issue Oct 31, 2023 · 2 comments · Fixed by #23812

Comments

@calebak404
Copy link

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 and review the contribution guide to help.

Terraform Version

1.5.2

AzureRM Provider Version

3.78

Affected Resource(s)/Data Source(s)

azurerm_windows_web_app, azurerm_windows_web_app_slot

Terraform Configuration Files

resource "azurerm_windows_web_app" "web_app" {
    dynamic "auto_heal_setting" {
      for_each = local.auto_heal_rule
      content {
        action {
          action_type = auto_heal_setting.value["action"].type
          dynamic "custom_action" {
            for_each = auto_heal_setting.value["action"].type == "CustomAction" ? ["1"] : []
            content {
              executable = auto_heal_setting.value["action"].custom_action.executable
              parameters = auto_heal_setting.value["action"].custom_action.parameters
            }
          }
          minimum_process_execution_time = auto_heal_setting.value["action"].minimum_execution_time
        }
        trigger {
          dynamic "status_code" {
            for_each = toset([for trigger in auto_heal_setting.value["trigger"] : trigger if trigger.type == "StatusCode"])
            content {
              count             = status_code.value["count"]
              interval          = status_code.value["interval"]
              status_code_range = status_code.value["value"]
              path              = status_code.value["path"] == "" ? var.auto_heal_enabled : status_code.value["path"]
            }
          }
          private_memory_kb = one(toset([for trigger in auto_heal_setting.value["trigger"] : trigger.value if trigger.type == "PrivateMemory"]))
        }
      }
    }
}

Debug Output/Panic Output

Stack trace from the terraform-provider-azurerm_v3.78.0_x5 plugin:

panic: runtime error: index out of range [0] with length 0

goroutine 1444 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers.expandAutoHealSettingsWindows({0xc002665110, 0x913a00b?, 0xc0016458a0?})
github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers/auto_heal.go:405 +0xc6f
github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers.(*SiteConfigWindowsWebAppSlot).ExpandForUpdate(0xc001646ad8, {0xc000e57680, {0x998d838, 0xc0003f2e28}, 0xc002034480, 0x0, {0x998d9f8, 0xf59a8e0}}, 0xc000dcc500, 0xc0024e2f00)
github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers/web_app_slot_schema.go:1278 +0x1965
github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice.(*WindowsWebAppSlotResource).Update.WindowsWebAppSlotResource.Update.func1({0x998b1b8, 0xc0002eb9d0}, {0xc000e57680, {0x998d838, 0xc0003f2e28}, 0xc002034480, 0x0, {0x998d9f8, 0xf59a8e0}})
github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/windows_web_app_slot_resource.go:763 +0xbcc
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.func7({0x998b1b8, 0xc0002eb9d0}, 0x0?, {0x8229b60?, 0xc000e57680?})
github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:121 +0x150
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.(*ResourceWrapper).diagnosticsWrapper.diagnosticsWrapper.func13({0x998b1b8?, 0xc0002eb9d0?}, 0x0?, {0x8229b60?, 0xc000e57680?})
github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:190 +0x59
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc0004edb20, {0x998b110, 0xc00185c420}, 0xd?, {0x8229b60, 0xc000e57680})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:812 +0x11b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0004edb20, {0x998b110, 0xc00185c420}, 0xc002a3aa90, 0xc002321400, {0x8229b60, 0xc000e57680})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:919 +0x83a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00023d6b0, {0x998b110?, 0xc00185c330?}, 0xc003543810)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1060 +0xdbc
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0012fea00, {0x998b110?, 0xc0025ab7d0?}, 0xc00096c3f0)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:859 +0x56a
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x8d02020?, 0xc0012fea00}, {0x998b110, 0xc0025ab7d0}, 0xc00096c380, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:467 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003221e0, {0x999c8a0, 0xc00198e1a0}, 0xc002137320, 0xc001a56e40, 0xf55a9f8, 0x0)
google.golang.org/[email protected]/server.go:1374 +0xde7
google.golang.org/grpc.(*Server).handleStream(0xc0003221e0, {0x999c8a0, 0xc00198e1a0}, 0xc002137320, 0x0)
google.golang.org/[email protected]/server.go:1751 +0x9e7
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/[email protected]/server.go:986 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 52
google.golang.org/[email protected]/server.go:997 +0x145

Error: The terraform-provider-azurerm_v3.78.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Expected Behaviour

Terraform applies the configuration.

Actual Behaviour

Provider panics.

Steps to Reproduce

No response

Important Factoids

No response

References

Likely issue was fixed for linux_web_app in #21328

@calebak404
Copy link
Author

#23812 does not address if autoHeal.Actions is empty and does not have parity with the equivalent changes in the linux resource.

Copy link

github-actions bot commented May 2, 2024

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 May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.