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

Permissions principal lookup crashes if user is removed #1250

Open
davidcorrigan714 opened this issue Dec 6, 2024 · 0 comments
Open

Permissions principal lookup crashes if user is removed #1250

davidcorrigan714 opened this issue Dec 6, 2024 · 0 comments

Comments

@davidcorrigan714
Copy link
Contributor

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

Terraform (and Azure DevOps Provider) Version

Provider version 1.4.0

If an ADO descriptor in the state file, called "principal" in that file, cannot be found the plugin crashes here-ish like so:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xcd0bd8]

goroutine 2401 [running]:
github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/permissions/utils.(*SecurityNamespace).GetPrincipalPermissions.func1({0x10123c0?, 0xc000564870?})
github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/permissions/utils/namespaces.go:442 +0x98
reflect.Value.call({0xe82ee0?, 0x10ab690?, 0x18?}, {0x103b30f, 0x4}, {0xc0008681c8, 0x1, 0xc0008681c8?})
reflect/value.go:596 +0xca6
reflect.Value.Call({0xe82ee0?, 0x10ab690?, 0xc000564120?}, {0xc0008681c8?, 0x7ffbd4e0aa68?, 0x18?})
reflect/value.go:380 +0xb9
github.com/ahmetb/go-linq.(*genericFunc).Call(0xc000ba37b8, {0xc000172c70, 0x1, 0x1?})
github.com/ahmetb/go-linq@v3.0.0+incompatible/genericfunc.go:35 +0x10b
github.com/ahmetb/go-linq.Query.SelectT.func1({0x10123c0?, 0xc000564870?})
github.com/ahmetb/go-linq@v3.0.0+incompatible/select.go:47 +0x45
github.com/ahmetb/go-linq.Query.SelectT.Query.Select.func3.1()
github.com/ahmetb/go-linq@v3.0.0+incompatible/select.go:24 +0x3b
github.com/ahmetb/go-linq.Query.ToSlice({0xe54e20?}, {0xe51ae0?, 0xc0008680d8?})
github.com/ahmetb/go-linq@v3.0.0+incompatible/result.go:634 +0x1bc
github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/permissions/utils.(*SecurityNamespace).GetPrincipalPermissions(0xc00090c780, 0xc0001730e0)
github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/permissions/utils/namespaces.go:444 +0xe5
github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/permissions/utils.GetPrincipalPermissions(0xc0006f1480, 0xc00090c780)
github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/permissions/utils/securityHelper.go:106 +0x105
github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/permissions.resourceServiceEndpointPermissionsRead(0xc0006f1480, {0xe29ce0?, 0xc0003f1380?})
github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/permissions/resource_serviceendpoint_permissions.go:66 +0x72
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x11be990?, {0x11be990?, 0xc000679f20?}, 0xd?, {0xe29ce0?, 0xc0003f1380?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:811 +0x15f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0003faee0, {0x11be990, 0xc000679f20}, 0xc00079f040, {0xe29ce0, 0xc0003f1380})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:1117 +0x529
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc00039c9f0, {0x11be990?, 0xc000679e60?}, 0xc00094a940)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/grpc_provider.go:708 +0x6c5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000240820, {0x11be990?, 0xc0006796b0?}, 0xc0008c4230)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/tf5server/server.go:783 +0x309
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x1004020, 0xc000240820}, {0x11be990, 0xc0006796b0}, 0xc0006f1100, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:482 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000c3a00, {0x11be990, 0xc000679620}, {0x11c38c0, 0xc000598000}, 0xc0008970e0, 0xc000483c20, 0x184dda8, 0x0)
google.golang.org/grpc@v1.63.2/server.go:1369 +0xdf8
google.golang.org/grpc.(*Server).handleStream(0xc0000c3a00, {0x11c38c0, 0xc000598000}, 0xc0008970e0)
google.golang.org/grpc@v1.63.2/server.go:1780 +0xe8b
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 22
google.golang.org/grpc@v1.63.2/server.go:1030 +0x125

Error: The terraform-provider-azuredevops_v1.4.0 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant