-
Notifications
You must be signed in to change notification settings - Fork 289
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
terraform-provider-azuread_v2.50.0_x5.exe plugin: panic: runtime error: invalid memory address or nil pointer dereference #1399
Comments
Hi @hales8181, thanks for reporting this. The provider should never crash, however looking into this it seems like this may have been most likely caused by a network or connection issue between your Terraform host and the MS Graph API. Does this happen consistently or was it just a one-off error? |
I could see a similar error when I tried to destroy the resource. But I think this is related with a similar resource, ╷
│ Error: Plugin did not respond
│
│ 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-azuread_v2.52.0_x5 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xb83f8d]
goroutine 97 [running]:
github.com/manicminer/hamilton/msgraph.(*PrivilegedAccessGroupAssignmentScheduleRequestsClient).Create(0xc000236380, {0x1095770, 0xc00027c7e0}, {0xc0002971a0, {0xc0002427c4, 0x6}, {0xf1871f, 0xb}, 0x0, 0x0, ...})
github.com/manicminer/hamilton@v0.70.0/msgraph/privilegedaccess_groups_assignmentschedule_requests.go:75 +0x32d
github.com/hashicorp/terraform-provider-azuread/internal/services/identitygovernance.revokeAssignmentRequest({0x1095770, 0xc00027c7e0}, {0xc000155b00, {0x1095620, 0xc0003f29c0}, 0xc000174d00, 0x0, {0x10958c0, 0x16fa9e0}}, 0xc000236380, ...)
github.com/hashicorp/terraform-provider-azuread/internal/services/identitygovernance/privileged_access_group_assignment_schedule_resource.go:294 +0x1d0
github.com/hashicorp/terraform-provider-azuread/internal/services/identitygovernance.(*PrivilegedAccessGroupAssignmentScheduleResource).Delete.PrivilegedAccessGroupAssignmentScheduleResource.Delete.func1({0x1095770, 0xc00027c7e0}, {0xc000155b00, {0x1095620, 0xc0003f29c0}, 0xc000174d00, 0x0, {0x10958c0, 0x16fa9e0}})
github.com/hashicorp/terraform-provider-azuread/internal/services/identitygovernance/privileged_access_group_assignment_schedule_resource.go:271 +0x315
github.com/hashicorp/terraform-provider-azuread/internal/sdk.(*ResourceWrapper).Resource.func4({0x1095770, 0xc00027c7e0}, 0x0?, {0xde8f20?, 0xc000155b00?})
github.com/hashicorp/terraform-provider-azuread/internal/sdk/wrapper_resource.go:72 +0x147
github.com/hashicorp/terraform-provider-azuread/internal/sdk.(*ResourceWrapper).Resource.(*ResourceWrapper).diagnosticsWrapper.diagnosticsWrapper.func12({0x1095770?, 0xc00027c7e0?}, 0x0?, {0xde8f20?, 0xc000155b00?})
github.com/hashicorp/terraform-provider-azuread/internal/sdk/wrapper_resource.go:190 +0x59
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).delete(0xc000407420, {0x10956c8, 0xc0002e3e90}, 0xd?, {0xde8f20, 0xc000155b00})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:829 +0x11b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000407420, {0x10956c8, 0xc0002e3e90}, 0xc0000c48f0, 0xc000174c80, {0xde8f20, 0xc000155b00})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:878 +0x605
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0003f2d38, {0x10956c8?, 0xc0002e3da0?}, 0xc000246690)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/grpc_provider.go:1060 +0xdbc
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc000350960, {0x10956c8?, 0xc0002e1ad0?}, 0xc000158c40)
github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/tf5server/server.go:859 +0x56a
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xedede0?, 0xc000350960}, {0x10956c8, 0xc0002e1ad0}, 0xc0001589a0, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:467 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002ac1e0, {0x109a310, 0xc000007d40}, 0xc00069c000, 0xc00046fce0, 0x16bcdb8, 0x0)
google.golang.org/grpc@v1.57.1/server.go:1358 +0xe15
google.golang.org/grpc.(*Server).handleStream(0xc0002ac1e0, {0x109a310, 0xc000007d40}, 0xc00069c000, 0x0)
google.golang.org/grpc@v1.57.1/server.go:1735 +0x9e7
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/grpc@v1.57.1/server.go:970 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 25
google.golang.org/grpc@v1.57.1/server.go:981 +0x145
Error: The terraform-provider-azuread_v2.52.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. |
Also seeing this issue in v2.53.1. This is occurring when terraform is trying to destroy an eligibility assignment that is in "Expired" state.
|
Also encountered the provider crashing. We have a number of schedules on groups and should the duration of these change the provider currently does not update these as per #1412 , so they need to be removed and then added again as a workaround. Error: retrieving Privileged Access Group Assigment Schedule ID: "00000000-0000-0000-0000-000000000000_owner_22222222-2222-2222-2222-222222222222": PrivilegedAccessGroupEligibilityScheduleRequestsClient.BaseClient.Post(): unexpected status 400 with OData error: PendingRoleAssignmentRequest: There is already an existing pending Role assignment request. (also seems there is small typo in the error message - Assigment should be Assignment) Despite this error during the apply, the schedule was removed, but remained in state. I guess this is another bug in the provider, but currently not in a position to document that one clearly - will try to get back to that later. The subsequent plan show the item will be destroyed:
As stated above, this schedule does not exist, this was verified in the Azure portal When applying the plan to destroy the non-existent schedule the provider crashes:
Removal of the resource instance from state resolved the issue as a workaround. |
When replacing a azuread_privileged_access_group_eligibility_schedule the plug in crashes when trying to destroy an existing eligbility schedule, and then subsequently continues on, tries to add the schedule but fails due to the role assigniment already existing.
╷ │ Error: Plugin did not respond │ │ 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 │ │ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details. ╵ ╷ │ Error: Could not create assignment schedule request, PrivilegedAccessGroupEligibilityScheduleRequestsClient.BaseClient.Post(): unexpected status 400 with OData error: RoleAssignmentExists: The Role assignment already exists. │
Stack trace:
`Stack trace from the terraform-provider-azuread_v2.50.0_x5.exe plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x40 pc=0xf1d6cd]
goroutine 98 [running]:
github.com/manicminer/hamilton/msgraph.(*PrivilegedAccessGroupEligibilityScheduleRequestsClient).Create(0xc00021e070, {0x1430a90, 0xc000210070}, {0xc0003e1080, {0xc000782110, 0x6}, {0x12aeefc, 0xb}, 0x0, 0x0, ...})
github.com/manicminer/hamilton@v0.68.0/msgraph/privilegedaccess_groups_eligibilityschedule_request.go:74 +0x32d
github.com/hashicorp/terraform-provider-azuread/internal/services/identitygovernance.revokeEligibilityRequest({0x1430a90, 0xc000210070}, {0xc0003bc900, {0x14309b0, 0xc0003baba0}, 0xc00098e180, 0x0, {0x1430c50, 0x1acf5c0}}, 0xc00021e070, ...)
github.com/hashicorp/terraform-provider-azuread/internal/services/identitygovernance/privileged_access_group_eligiblity_schedule_resource.go:294 +0x1d0
github.com/hashicorp/terraform-provider-azuread/internal/services/identitygovernance.(*PrivilegedAccessGroupEligibilityScheduleResource).Delete.PrivilegedAccessGroupEligibilityScheduleResource.Delete.func1({0x1430a90, 0xc000210070}, {0xc0003bc900, {0x14309b0, 0xc0003baba0}, 0xc00098e180, 0x0, {0x1430c50, 0x1acf5c0}})
github.com/hashicorp/terraform-provider-azuread/internal/services/identitygovernance/privileged_access_group_eligiblity_schedule_resource.go:271 +0x315
github.com/hashicorp/terraform-provider-azuread/internal/sdk.(*ResourceWrapper).Resource.func4({0x1430a90, 0xc000210070}, 0x0?, {0x117da40?, 0xc0003bc900?})
github.com/hashicorp/terraform-provider-azuread/internal/sdk/wrapper_resource.go:72 +0x147
github.com/hashicorp/terraform-provider-azuread/internal/sdk.(*ResourceWrapper).Resource.(*ResourceWrapper).diagnosticsWrapper.diagnosticsWrapper.func12({0x1430a90?, 0xc000210070?}, 0x0?, {0x117da40?, 0xc0003bc900?})
github.com/hashicorp/terraform-provider-azuread/internal/sdk/wrapper_resource.go:190 +0x59
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).delete(0xc0003d5500, {0x14309e8, 0xc000458b10}, 0xd?, {0x117da40, 0xc0003bc900})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:829 +0x11b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0003d5500, {0x14309e8, 0xc000458b10}, 0xc0004c71e0, 0xc00098e100, {0x117da40, 0xc0003bc900})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:878 +0x605
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000522048, {0x14309e8?, 0xc000458a20?}, 0xc000786140)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/grpc_provider.go:1060 +0xdbc
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00054a000, {0x14309e8?, 0xc000458180?}, 0xc000258070)
github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/tf5server/server.go:859 +0x56a
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1275860?, 0xc00054a000}, {0x14309e8, 0xc000458180}, 0xc000258000, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:467 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002781e0, {0x14356d0, 0xc00058c340}, 0xc000790000, 0xc000510720, 0x1a6cd58, 0x0)
google.golang.org/grpc@v1.57.1/server.go:1358 +0xe15
google.golang.org/grpc.(*Server).handleStream(0xc0002781e0, {0x14356d0, 0xc00058c340}, 0xc000790000, 0x0)
google.golang.org/grpc@v1.57.1/server.go:1735 +0x9e7
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/grpc@v1.57.1/server.go:970 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 39
google.golang.org/grpc@v1.57.1/server.go:981 +0x145
Error: The terraform-provider-azuread_v2.50.0_x5.exe 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.`
The text was updated successfully, but these errors were encountered: