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

Change to IpGroups causes crash Sinds version 3.75.0 #24018

Closed
1 task done
hend0012 opened this issue Nov 24, 2023 · 3 comments · Fixed by #24031
Closed
1 task done

Change to IpGroups causes crash Sinds version 3.75.0 #24018

hend0012 opened this issue Nov 24, 2023 · 3 comments · Fixed by #24031

Comments

@hend0012
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.6.4

AzureRM Provider Version

azurerm_v3.79.0_x5

Affected Resource(s)/Data Source(s)

azurerm_ip_group, azurerm_firewall_policies

Terraform Configuration Files

ip_groups = {
  G-XXXXXL-NETWORKS = {
    cidrs = [
      "xxx.xxx.xxx.0/22",
    ]
    name               = "G-XXXXXXX-NETWORKS"
    resource_group_key = "hub-xx-weu-networxking-ipgxros"
    tags = {
      "environment" : "Integration"
    }
  }
}

Debug Output/Panic Output

Error: Plugin did not respond
│ 
│   with module.caf.module.azurerm_firewall_policies["XXX-XXX-XX"].azurerm_firewall_policy.fwpol,
│   on .terraform/modules/caf/modules/networking/firewall_policies/firewall_policy.tf line 16, in resource "azurerm_firewall_policy" "fwpol":
│   16: resource "azurerm_firewall_policy" "fwpol" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵
╷
│ Error: Plugin did not respond
│ 
│   with module.caf.module.ip_groups["XXX-XXX-XXX"].azurerm_ip_group.ip_group,
│   on .terraform/modules/caf/modules/networking/ip_group/module.tf line 24, in resource "azurerm_ip_group" "ip_group":
│   24: resource "azurerm_ip_group" "ip_group" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

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

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x20 pc=0x10a74a0a8]

goroutine 125 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/network.resourceIpGroupUpdate(0x0?, {0x10c9329a0?, 0x14001c23680?})
        github.com/hashicorp/terraform-provider-azurerm/internal/services/network/ip_group_resource.go:206 +0x2d8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0x10d804f48?, {0x10d804f48?, 0x1400280f1d0?}, 0xd?, {0x10c9329a0?, 0x14001c23680?})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:800 +0x134
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x14001496fc0, {0x10d804f48, 0x1400280f1d0}, 0x14000ed3a00, 0x140024aa100, {0x10c9329a0, 0x14001c23680})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:919 +0x658
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x140004cb248, {0x10d804f48?, 0x1400280f0e0?}, 0x1400202f2c0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/grpc_provider.go:1060 +0xb08
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x140012906e0, {0x10d804f48?, 0x1400280e8d0?}, 0x1400025f340)
        github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/tf5server/server.go:859 +0x3c0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x10d410c20?, 0x140012906e0}, {0x10d804f48, 0x1400280e8d0}, 0x1400025f2d0, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:467 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x140002281e0, {0x10d8166c0, 0x140004051e0}, 0x1400280ca20, 0x14001504e40, 0x1132eac78, 0x0)
        google.golang.org/grpc@v1.58.3/server.go:1374 +0xb44
google.golang.org/grpc.(*Server).handleStream(0x140002281e0, {0x10d8166c0, 0x140004051e0}, 0x1400280ca20, 0x0)
        google.golang.org/grpc@v1.58.3/server.go:1751 +0x7c4
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/grpc@v1.58.3/server.go:986 +0xb4
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 41
        google.golang.org/grpc@v1.58.3/server.go:997 +0x160

Error: The terraform-provider-azurerm_v3.79.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

An correct update of the I-groups

Actual Behaviour

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

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x20 pc=0x10a74a0a8]

goroutine 125 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/network.resourceIpGroupUpdate(0x0?, {0x10c9329a0?, 0x14001c23680?})
github.com/hashicorp/terraform-provider-azurerm/internal/services/network/ip_group_resource.go:206 +0x2d8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0x10d804f48?, {0x10d804f48?, 0x1400280f1d0?}, 0xd?, {0x10c9329a0?, 0x14001c23680?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:800 +0x134
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x14001496fc0, {0x10d804f48, 0x1400280f1d0}, 0x14000ed3a00, 0x140024aa100, {0x10c9329a0, 0x14001c23680})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:919 +0x658
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x140004cb248, {0x10d804f48?, 0x1400280f0e0?}, 0x1400202f2c0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/grpc_provider.go:1060 +0xb08
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x140012906e0, {0x10d804f48?, 0x1400280e8d0?}, 0x1400025f340)
github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/tf5server/server.go:859 +0x3c0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x10d410c20?, 0x140012906e0}, {0x10d804f48, 0x1400280e8d0}, 0x1400025f2d0, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:467 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x140002281e0, {0x10d8166c0, 0x140004051e0}, 0x1400280ca20, 0x14001504e40, 0x1132eac78, 0x0)
google.golang.org/grpc@v1.58.3/server.go:1374 +0xb44
google.golang.org/grpc.(*Server).handleStream(0x140002281e0, {0x10d8166c0, 0x140004051e0}, 0x1400280ca20, 0x0)
google.golang.org/grpc@v1.58.3/server.go:1751 +0x7c4
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/grpc@v1.58.3/server.go:986 +0xb4
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 41
google.golang.org/grpc@v1.58.3/server.go:997 +0x160

Error: The terraform-provider-azurerm_v3.79.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.

Steps to Reproduce

I have traced the issue back to release 3.75.0. Version 3.74.0 was still working correctly, but as of version 3.75.0 I see this

ENHANCEMENTS:

dependencies: firewall migrated to hashicorp/go-azure-sdk (#22863)

Everything is working correctly with version 3.74.0, the crashes start happening at version 3.75.0

Important Factoids

Everything is working correctly with version 3.74.0, the crashes start happening at version 3.75.0

References

No response

@wuxu92
Copy link
Contributor

wuxu92 commented Nov 27, 2023

Hi @hend0012 Thanks for filing this issue! It would be really helpful if you could provide a minimal Terraform configuration that can reproduce the issue.

And could you please share the firewall_policy_id value of the azurerm_ip_group reosurce in the terraform.state file? because it seems the value from state file caused the panic.

@hend0012
Copy link
Author

  • Hi @hend0012 Thanks for filing this issue! It would be really helpful if you could provide a minimal Terraform configuration that can reproduce the issue.

This is hard todo as everything is separated in modules which are not public. Its basically a forked and stripped version of the module you can find here: https://github.com/aztfmod/terraform-azurerm-caf

firewall_policy_id = "/subscriptions/xxxxx-xxxx-xxxx-xxxxx-xxxxxxxx/resourceGroups/hub-p-weu-networking/providers/Microsoft.Network/firewallPolicies/XXX-XX"

@rcskosir rcskosir added the v/3.x label Nov 27, 2023
@github-actions github-actions bot added this to the v3.83.0 milestone Nov 28, 2023
Copy link

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

Successfully merging a pull request may close this issue.

3 participants