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

azurerm_windows_web_app plugin crashes when app_settings is empty #22435

Closed
1 task done
UntiIted opened this issue Jul 10, 2023 · 5 comments · Fixed by #23303
Closed
1 task done

azurerm_windows_web_app plugin crashes when app_settings is empty #22435

UntiIted opened this issue Jul 10, 2023 · 5 comments · Fixed by #23303

Comments

@UntiIted
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.1

AzureRM Provider Version

3.64.0

Affected Resource(s)/Data Source(s)

azurerm_windows_web_app

Terraform Configuration Files

data "azurerm_container_registry" "this" {
  name                = "example"
  resource_group_name = "example"
}

data "azurerm_service_plan" "this" {
  name                = "example"
  resource_group_name = "example"
}

resource "azurerm_windows_web_app" "this" {
  name                = "example"
  resource_group_name = "example"
  location            = data.azurerm_service_plan.this.location
  service_plan_id     = data.azurerm_service_plan.this.id

  https_only              = true
  client_affinity_enabled = false

  site_config {
    always_on         = "true"
    ftps_state        = "Disabled"
    use_32_bit_worker = true

    application_stack {
      docker_image_name        = "hello-world:windows"
      docker_registry_url      = "https://${data.azurerm_container_registry.this.login_server}"
      docker_registry_username = data.azurerm_container_registry.this.admin_username
      docker_registry_password = data.azurerm_container_registry.this.admin_password
    }
  }
}

Debug Output/Panic Output

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

panic: assignment to entry in nil map

goroutine 104 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers.(*SiteConfigWindows).ExpandForCreate(0xc001c56af0, 0x0)
        github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers/windows_web_app_schema.go:525 +0xfe8
github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice.WindowsWebAppResource.Create.func1({0x7f30cc8, 0xc001fb5050}, {0xc0008bc800, {0x7f31550, 0xc000529860}, 0xc001337580, 0x0, {0x7f32698, 0xc685730}})
        github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/windows_web_app_resource.go:329 +0xe10
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.func2({0x7f30cc8, 0xc001fb5050}, 0x7f30d00?, {0x6ae7e80?, 0xc0008bc800?})
        github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:55 +0x163
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.diagnosticsWrapper.func1({0x7f30cc8, 0xc001fb5050}, 0x0?, {0x6ae7e80, 0xc0008bc800})
        github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:188 +0xb8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0001f10a0, {0x7f30d00, 0xc001db4f00}, 0xd?, {0x6ae7e80, 0xc0008bc800})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/resource.go:707 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0001f10a0, {0x7f30d00, 0xc001db4f00}, 0xc0021a12b0, 0xc001337400, {0x6ae7e80, 0xc0008bc800})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc001327ed8, {0x7f30d00?, 0xc001db4de0?}, 0xc0001469b0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0007b5a40, {0x7f30d00?, 0xc001db43f0?}, 0xc000566fc0)
        github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x72f42a0?, 0xc0007b5a40}, {0x7f30d00, 0xc001db43f0}, 0xc000566f50, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001d21e0, {0x7f41400, 0xc001a7a000}, 0xc002348d80, 0xc001985ef0, 0xc620840, 0x0)
        google.golang.org/grpc@v1.53.0/server.go:1336 +0xd33
google.golang.org/grpc.(*Server).handleStream(0xc0001d21e0, {0x7f41400, 0xc001a7a000}, 0xc002348d80, 0x0)
        google.golang.org/grpc@v1.53.0/server.go:1704 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.53.0/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.53.0/server.go:963 +0x28a

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

Expected Behaviour

Web app is created successfully.

Actual Behaviour

Web app fails to create with plugin crash.

Steps to Reproduce

  1. Use terraform to create a web app with a docker image and don't specify app_settings
  2. terraform init
  3. terraform apply

Important Factoids

No response

References

No response

@xiaxyi
Copy link
Contributor

xiaxyi commented Jul 11, 2023

Thanks @UntiIted for raising this issue, let me try reproducing it from my side and update once I have any progress.

@wuxu92
Copy link
Contributor

wuxu92 commented Jul 11, 2023

@xiaxyi this should just the same scenario as #22347

@xiaxyi
Copy link
Contributor

xiaxyi commented Jul 12, 2023

Thanks @wuxu92 for helping to resolve this bug. There is another issue that need to be fixed based on your pr and I will handle it. :)

@UntiIted
Copy link
Author

If this is the same issue as linux web apps, then slot resources for windows and linux should also be tested

Copy link

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