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

compute.expandOrchestratedVirtualMachineScaleSetExtension: panic: interface conversion: interface {} is nil, not bool #27307

Open lmalmeida opened 1 week ago

lmalmeida commented 1 week ago

Is there an existing issue for this?

Community Note

Terraform Version

1.9.5

AzureRM Provider Version

4.0.1

Affected Resource(s)/Data Source(s)

azurerm_linux_virtual_machine_scale_set

Terraform Configuration Files

Not clear

Debug Output/Panic Output

Stack trace from the terraform-provider-azurerm_v4.0.1_x5 plugin:

panic: interface conversion: interface {} is nil, not bool

goroutine 48 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/compute.expandOrchestratedVirtualMachineScaleSetExtensions({0xc003335360, 0x5, 0x82d9a25?})
    github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/orchestrated_virtual_machine_scale_set.go:1439 +0xe95
github.com/hashicorp/terraform-provider-azurerm/internal/services/compute.resourceLinuxVirtualMachineScaleSetUpdate(0xc0036f7300, {0x729ca40?, 0xc001f5f680})
    github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/linux_virtual_machine_scale_set_resource.go:745 +0x2937
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0x8b0b138?, {0x8b0b138?, 0xc0036d7050?}, 0xd?, {0x729ca40?, 0xc001f5f680?})
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:800 +0x163
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000e776c0, {0x8b0b138, 0xc0036d7050}, 0xc001a05ad0, 0xc0036f7080, {0x729ca40, 0xc001f5f680})
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:919 +0x83a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0003b6b58, {0x8b0b138?, 0xc0036d6f60?}, 0xc0036d8370)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/grpc_provider.go:1078 +0xdbc
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0x8b0b170?, {0x8b0b138?, 0xc0036d6c60?}, 0xc0036d8370)
    github.com/hashicorp/terraform-plugin-mux@v0.15.0/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc001c2b040, {0x8b0b138?, 0xc0036d6240?}, 0xc001974000)
    github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/tf5server/server.go:865 +0x3d0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x7fbc4a0?, 0xc001c2b040}, {0x8b0b138, 0xc0036d6240}, 0xc0036f6000, 0x0)
    github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000177000, {0x8b0b138, 0xc0036d61b0}, {0x8b37b20, 0xc0001fa600}, 0xc0036de000, 0xc0014e1d70, 0xe172798, 0x0)
    google.golang.org/grpc@v1.63.2/server.go:1369 +0xe23
google.golang.org/grpc.(*Server).handleStream(0xc000177000, {0x8b37b20, 0xc0001fa600}, 0xc0036de000)
    google.golang.org/grpc@v1.63.2/server.go:1780 +0x1016
google.golang.org/grpc.(*Server).serveStreams.func2.1()
    google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 26
    google.golang.org/grpc@v1.63.2/server.go:1030 +0x135

Error: The terraform-provider-azurerm_v4.0.1_x5 plugin crashed!

Expected Behaviour

No crash

Actual Behaviour

Crashes. Error also happened with v4.1.0 of the provider

Steps to Reproduce

No response

Important Factoids

No response

References

No response

mouellet commented 1 week ago

Looks like the extension block from the azurerm_orchestrated_virtual_machine_scale_set resource is different then the one from the azurerm_linux_virtual_machine_scale_set... auto_upgrade_minor_version_enabled vs. auto_upgrade_minor_version...

This append when updating the automatic_instance_repair block w/ the new action attribut...

nilesingalls commented 5 days ago

I'm having this same issue, version 3.3 & 4.1.0 terraform v1.9.2 on osx on arm