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

Error: The terraform-provider-azurerm_v4.6.0_x5 plugin crashed! #27710

Closed
1 task done
Pidgegeddon opened this issue Oct 21, 2024 · 10 comments
Closed
1 task done

Error: The terraform-provider-azurerm_v4.6.0_x5 plugin crashed! #27710

Pidgegeddon opened this issue Oct 21, 2024 · 10 comments

Comments

@Pidgegeddon
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 comments along the lines of "+1", "me too" or "any updates", 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.9.7

AzureRM Provider Version

4.6.0

Affected Resource(s)/Data Source(s)

azurerm_role_management_policy

Terraform Configuration Files

resource "azurerm_role_management_policy" "example" {
  scope              = "/providers/Microsoft.Management/managementGroups/example"
  role_definition_id = "/providers/Microsoft.Authorization/roleDefinitions/00482a5a-887f-4fb3-b363-3b7fe8e74483"

  activation_rules {
    maximum_duration      = "PT4H"
    require_justification = true
  }

  eligible_assignment_rules {
    expiration_required = false
  }

  lifecycle {
    ignore_changes = [
      activation_rules[0].approval_stage,
    ]
  }
}

Debug Output/Panic Output

╷
│ Error: Request cancelled
│ 
│   with azurerm_role_management_policy.****["key_vault_administrator"],
│   on ccoe-pim.tf line 2, in resource "azurerm_role_management_policy" "****":
│    2: resource "azurerm_role_management_policy" "****" {
│ 
│ The plugin.(*GRPCProvider).ReadResource request was cancelled.
╵
Stack trace from the terraform-provider-azurerm_v4.6.0_x5 plugin:

panic: interface conversion: rolemanagementpolicies.RoleManagementPolicyRule is rolemanagementpolicies.RoleManagementPolicyEnablementRule, not rolemanagementpolicies.RawRoleManagementPolicyRuleImpl

goroutine 806 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization.(*RoleManagementPolicyResource).Read.RoleManagementPolicyResource.Read.func1({0x8858bc0, 0xc000629110}, {0xc001adfb08, {0x885b400, 0xc00032f8c0}, 0xc00434cc00, 0x0, {0x885c388, 0xdda3280}})
	github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization/role_management_policy_resource.go:466 +0x1e98
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.func3({0x8858bc0, 0xc000629110}, 0xc000629110?, {0x70111e0?, 0xc001adfb08?})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:68 +0x145
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.(*ResourceWrapper).diagnosticsWrapper.diagnosticsWrapper.func11({0x8858bc0?, 0xc000629110?}, 0x45d964b800?, {0x70111e0?, 0xc001adfb08?})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:192 +0x59
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc00048d7a0, {0x8858b18, 0xc004359560}, 0xc00434cc00, {0x70111e0, 0xc001adfb08})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:795 +0x119
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc00048d7a0, {0x8858b18, 0xc004359560}, 0xc00436a820, {0x70111e0, 0xc001adfb08})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1089 +0x529
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc000b55668, {0x8858b18?, 0xc0043594a0?}, 0xc004225d40)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:667 +0x4aa
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ReadResource(0xc001e4b420, {0x8858b18?, 0xc0043591d0?}, 0xc004225d40)
	github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ReadResource.go:35 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc00126bcc0, {0x8858b18?, 0xc0043589f0?}, 0xc0006133b0)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:783 +0x309
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x7d172e0, 0xc00126bcc0}, {0x8858b18, 0xc0043589f0}, 0xc00434c280, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:482 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000169000, {0x8858b18, 0xc004358960}, {0x8885520, 0xc0001f4900}, 0xc00431c360, 0xc001a45500, 0xdd30388, 0x0)
	google.golang.org/[email protected]/server.go:1369 +0xdf8
google.golang.org/grpc.(*Server).handleStream(0xc000169000, {0x8885520, 0xc0001f4900}, 0xc00431c360)
	google.golang.org/[email protected]/server.go:1780 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/[email protected]/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 27
	google.golang.org/[email protected]/server.go:1030 +0x125

Error: The terraform-provider-azurerm_v4.6.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 plan should run normally.

Actual Behaviour

Plugin crashes

Steps to Reproduce

  1. Set azurerm = 4.6.0
  2. terraform plan
  3. plugin crash

When I set azurerm version to 4.5.0 there are no issues with terraform plan

Important Factoids

No response

References

No response

@Chambras
Copy link
Contributor

@Pidgegeddon any chance you could enable DEBUG and share that log?

@ziyeqf
Copy link
Contributor

ziyeqf commented Oct 23, 2024

Hi @Pidgegeddon, thanks for reporting.

The crash was due to an underlying SDK update, I submitted a PR (#27731) for this, it's in draft since I have testing to finish. You can subscribe the PR to keep a track. Thanks

@Pidgegeddon
Copy link
Author

@Chambras I enabled DEBUG outputs, but I can see that this contains a lot of PII. I tried to scrub this, but since it is a large repo this proved to be difficult. Not sure if there exists any tools that can assist with that 🤷

@ziyeqf Thank you for PR ☺️

@SamuelRochcongar
Copy link

Hi,
Exact same issue with azurerm_data_protection_backup_vault resource. Azurerm 4.6.0 but also 4.5.0. Could it be related ? Or need a new issue ?

@ziyeqf
Copy link
Contributor

ziyeqf commented Oct 24, 2024

Hi, Exact same issue with azurerm_data_protection_backup_vault resource. Azurerm 4.6.0 but also 4.5.0. Could it be related ? Or need a new issue ?

Please fill a new issue to help track

@devan-fedhi
Copy link

devan-fedhi commented Oct 27, 2024

They released Azurerm 4.7.0 but the bug still seems to stand for azurerm_role_management_policy

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

panic: interface conversion: rolemanagementpolicies.RoleManagementPolicyRule is rolemanagementpolicies.RoleManagementPolicyNotificationRule, not rolemanagementpolicies.RawRoleManagementPolicyRuleImpl

goroutine 296 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization.buildRoleManagementPolicyForUpdate(0xc003dc4c00, 0xc003e36740)
	github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization/role_management_policy.go:65 +0x515b
github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization.(*RoleManagementPolicyResource).Create.RoleManagementPolicyResource.Create.func1({0x8886240, 0xc000c69960}, {0xc001ba1b08, {0x8888ab8, 0xc00077f200}, 0xc0032c1d00, 0x0, {0x8889a40, 0xddfb300}})
	github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization/role_management_policy_resource.go:387 +0x27c
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.func2({0x8886240, 0xc000c69960}, 0xc000c69960?, {0x70369c0?, 0xc001ba1b08?})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:55 +0x14d
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.(*ResourceWrapper).diagnosticsWrapper.diagnosticsWrapper.func10({0x8886240?, 0xc000c69960?}, 0x1a3185c5000?, {0x70369c0?, 0xc001ba1b08?})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:192 +0x59
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0007a2620, {0x8886198, 0xc003345590}, 0xc0032c1d00, {0x70369c0, 0xc001ba1b08})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:778 +0x119
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0007a2620, {0x8886198, 0xc003345590}, 0xc001d50d00, 0xc0032c0e00, {0x70369c0, 0xc001ba1b08})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:909 +0xa89
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000492168, {0x8886198?, 0xc0033454d0?}, 0xc00335c000)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1078 +0xd5c
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0xc0007d4700, {0x8886198?, 0xc003345200?}, 0xc00335c000)
	github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00121cf00, {0x8886198?, 0xc003344a20?}, 0xc000962d20)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:865 +0x3d0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x7d3fb40, 0xc00121cf00}, {0x8886198, 0xc003344a20}, 0xc0032c0700, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000167000, {0x8886198, 0xc003344990}, {0x88b2e20, 0xc0001f6600}, 0xc0032bbc20, 0xc000aaed20, 0xdd88438, 0x0)
	google.golang.org/[email protected]/server.go:1369 +0xdf8
google.golang.org/grpc.(*Server).handleStream(0xc000167000, {0x88b2e20, 0xc0001f6600}, 0xc0032bbc20)
	google.golang.org/[email protected]/server.go:1780 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/[email protected]/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 17
	google.golang.org/[email protected]/server.go:1030 +0x125

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

@ziyeqf
Copy link
Contributor

ziyeqf commented Oct 28, 2024

Hi @devan-fedhi, as the PR mentioned above (#27731) is not merged, this was not fixed on v4.7.0, you can subscribe that PR to keep track.

@audunsolemdal
Copy link
Contributor

Seems to be solved in provider version 4.8.0.

@katbyte
Copy link
Collaborator

katbyte commented Nov 1, 2024

fixed by #27731 according to @ziyeqf

@katbyte katbyte closed this as completed Nov 1, 2024
@katbyte katbyte added this to the v4.8.0 milestone Nov 1, 2024
Copy link

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

No branches or pull requests

7 participants