jianyuan / terraform-provider-sentry

Terraform provider for Sentry
https://registry.terraform.io/providers/jianyuan/sentry/latest
MIT License
331 stars 131 forks source link

Segfault crash on terraform refresh #477

Open OJFord opened 3 months ago

OJFord commented 3 months ago
╷
│ Error: Request cancelled
│
│ The plugin6.(*GRPCProvider).ReadDataSource request was cancelled.
╵

Stack trace from the terraform-provider-sentry_v0.13.1 plugin:

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

goroutine 113 [running]:
github.com/jianyuan/go-sentry/v2/sentry.CheckResponse(0x100cd3720?)
    github.com/jianyuan/go-sentry/v2@v2.8.1/sentry/sentry.go:356 +0x20
github.com/jianyuan/terraform-provider-sentry/internal/sentryclient.(*Config).Client.func1(0x100e06100?, 0x1013dd6c0?, 0x14000114248?, 0x100e001e0?)
    github.com/jianyuan/terraform-provider-sentry/internal/sentryclient/sentryclient.go:35 +0x30
github.com/hashicorp/go-retryablehttp.(*Client).Do(0x140003d1780, 0x14000592528)
    github.com/hashicorp/go-retryablehttp@v0.7.7/client.go:754 +0xad0
github.com/hashicorp/go-retryablehttp.(*RoundTripper).RoundTrip(0x1400013cb70, 0x14000013e00?)
    github.com/hashicorp/go-retryablehttp@v0.7.7/roundtripper.go:47 +0x78
github.com/jianyuan/terraform-provider-sentry/internal/sentryclient.(*semaphoreTransport).RoundTrip(0x140003f81e0, 0x1400019f200)
    github.com/jianyuan/terraform-provider-sentry/internal/sentryclient/sentryclient.go:79 +0x230
net/http.send(0x1400019f200, {0x100e00280, 0x140003f81e0}, {0x1006f1a10?, 0x8?, 0x0?})
    net/http/client.go:260 +0x4e0
net/http.(*Client).send(0x140003f8210, 0x1400019f200, {0x14000388c30?, 0x30?, 0x0?})
    net/http/client.go:181 +0x9c
net/http.(*Client).do(0x140003f8210, 0x1400019f200)
    net/http/client.go:724 +0x6f4
net/http.(*Client).Do(...)
    net/http/client.go:590
github.com/jianyuan/go-sentry/v2/sentry.(*Client).BareDo(0x14000114ba8?, {0x100e06138, 0x140000134a0}, 0x1400019f200?)
    github.com/jianyuan/go-sentry/v2@v2.8.1/sentry/sentry.go:255 +0x38
github.com/jianyuan/go-sentry/v2/sentry.(*Client).Do(0x140003d50a0?, {0x100e06138?, 0x140000134a0?}, 0x140004b8120?, {0x100c89d80?, 0x14000592510})
    github.com/jianyuan/go-sentry/v2@v2.8.1/sentry/sentry.go:273 +0x44
github.com/jianyuan/go-sentry/v2/sentry.(*OrganizationProjectsService).List(0x140003d50c0, {0x100e06138, 0x140000134a0}, {0x1400041e8f0?, 0x100e0cda8?}, 0x14000583a40?)
    github.com/jianyuan/go-sentry/v2@v2.8.1/sentry/organization_projects.go:32 +0xf4
github.com/jianyuan/terraform-provider-sentry/internal/provider.(*AllProjectsDataSource).Read(0x1400007ec40, {0x100e06138, 0x140000134a0}, {{{{0x100e0ad00, 0x14000388030}, {0x100ce03e0, 0x14000013e00}}, {0x100e0cda8, 0x14000583a40}}, {{{0x0, ...}, ...}, ...}, ...}, ...)
    github.com/jianyuan/terraform-provider-sentry/internal/provider/data_source_all_projects.go:150 +0x1b8
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadDataSource(0x140002781e0, {0x100e06138, 0x140000134a0}, 0x140004bd640, 0x14000115620)
    github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_readdatasource.go:103 +0x62c
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ReadDataSource(0x140002781e0, {0x100e06138?, 0x14000013380?}, 0x14000012ff0)
    github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/proto6server/server_readdatasource.go:55 +0x314
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ReadDataSource(0x100e06170?, {0x100e06138?, 0x14000013080?}, 0x14000012ff0)
    github.com/hashicorp/terraform-plugin-mux@v0.16.0/tf6muxserver/mux_server_ReadDataSource.go:36 +0x184
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadDataSource(0x1400027dc20, {0x100e06138?, 0x14000012660?}, 0x140000a6aa0)
    github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:688 +0x1d4
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadDataSource_Handler({0x100dd2460?, 0x1400027dc20}, {0x100e06138, 0x14000012660}, 0x1400017f200, 0x0)
    github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:572 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x140001ab000, {0x100e06138, 0x140000125d0}, {0x100e0b940, 0x140004fc000}, 0x14000163560, 0x140003870b0, 0x10139b140, 0x0)
    google.golang.org/grpc@v1.63.2/server.go:1369 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x140001ab000, {0x100e0b940, 0x140004fc000}, 0x14000163560)
    google.golang.org/grpc@v1.63.2/server.go:1780 +0xc80
google.golang.org/grpc.(*Server).serveStreams.func2.1()
    google.golang.org/grpc@v1.63.2/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 20
    google.golang.org/grpc@v1.63.2/server.go:1030 +0x150

Error: The terraform-provider-sentry_v0.13.1 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.
OJFord commented 3 months ago

Maybe this is #310 but I haven't had any problem using Sentry (website) this morning, just the above error with this provider repeatably.

OJFord commented 3 months ago

Ah, actually it does seem that user settings aren't loading (issues are fine so I didn't notice before).

lud0v1c commented 3 months ago

I am on "~> 0.13.0" and also experiencing this, and I recently upgraded to Terraform 1.9.x and Go 1.23.0, not sure if related? Anyway, can't apply/plan/destroy at all locally on my machine, only on CI/CD.. Any help would be great.