terraform-provider-airbyte icon indicating copy to clipboard operation
terraform-provider-airbyte copied to clipboard

v0.6.2 plugin crashes during `terraform apply`

Open mhw opened this issue 5 months ago • 1 comments

I'm seeing fairly frequent plugin crashes when running terraform apply. Retrying generally works, so it might be a race condition that's causing the concurrent map writes error. This is the stack trace output.

[multiple occurrences of the following]
│ Error: Plugin did not respond
│
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.

Stack trace from the terraform-provider-airbyte_v0.6.2 plugin:

fatal error: concurrent map writes

goroutine 42 [running]:
github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/hooks.(*clientCredentialsHook).BeforeRequest(0x1400051e0f0, {{{0x1065af1b8, 0x140006ed230}, {0x105d612d9, 0x13}, {0x10734d280, 0x0, 0x0}, 0x14000448630}}, 0x140005db8c0)
        github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/hooks/clientcredentials.go:85 +0x32c
github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/hooks.(*Hooks).BeforeRequest(0x1065af1b8?, {{{0x1065af1b8, 0x140006ed230}, {0x105d612d9, 0x13}, {0x10734d280, 0x0, 0x0}, 0x14000448630}}, 0x105d7fdc3?)
        github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/hooks/hooks.go:124 +0x98
github.com/airbytehq/terraform-provider-airbyte/internal/sdk.(*Destinations).CreateDestinationS3(0x14000440dc0, {0x1065af1b8, 0x140006ed230}, 0x140007a0000, {0x0, 0x0, 0x1400047c028?})
        github.com/airbytehq/terraform-provider-airbyte/internal/sdk/destinations.go:3474 +0x6ac
github.com/airbytehq/terraform-provider-airbyte/internal/provider.(*DestinationS3Resource).Create(0x14000690030, {0x1065af1b8, 0x140006ed230}, {{{{0x1065b8718, 0x14000942a50}, {0x106260c60, 0x140005b2f60}}, {0x1065ba650, 0x14000500000}}, {{{0x1065b8718, ...}, ...}, ...}, ...}, ...)
        github.com/airbytehq/terraform-provider-airbyte/internal/provider/destination_s3_resource.go:680 +0x1f4
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).CreateResource(0x140001336c0, {0x1065af1b8, 0x140006ed230}, 0x140005cd5b8, 0x140005cd590)
        github.com/hashicorp/[email protected]/internal/fwserver/server_createresource.go:101 +0x400
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ApplyResourceChange(0x140001336c0, {0x1065af1b8, 0x140006ed230}, 0x1400066a370, 0x140005cd6b0)
        github.com/hashicorp/[email protected]/internal/fwserver/server_applyresourcechange.go:57 +0x380
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ApplyResourceChange(0x140001336c0, {0x1065af1b8?, 0x140005a84e0?}, 0x1400072dcc0)
        github.com/hashicorp/[email protected]/internal/proto6server/server_applyresourcechange.go:55 +0x2e0
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0x140001e2e60, {0x1065af1b8?, 0x1400002b050?}, 0x140000d0000)
        github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:846 +0x2b4
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x1065725a0, 0x140001e2e60}, {0x1065af1b8, 0x1400002b050}, 0x1400001f300, 0x0)
        github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:518 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x14000193000, {0x1065af1b8, 0x1400002afc0}, {0x1065b8fe0, 0x140000fa000}, 0x14000592120, 0x14000307680, 0x1072d9198, 0x0)
        google.golang.org/[email protected]/server.go:1386 +0xb58
google.golang.org/grpc.(*Server).handleStream(0x14000193000, {0x1065b8fe0, 0x140000fa000}, 0x14000592120)
        google.golang.org/[email protected]/server.go:1797 +0xb10
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/[email protected]/server.go:1027 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 8
        google.golang.org/[email protected]/server.go:1038 +0x13c

goroutine 1 [select]:
github.com/hashicorp/go-plugin.Serve(0x1400012fe00)
        github.com/hashicorp/[email protected]/server.go:503 +0x11c4
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.Serve({0x105d84154, 0x27}, 0x140001fd040, {0x0, 0x0, 0x0})
        github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:316 +0x970
github.com/hashicorp/terraform-plugin-framework/providerserver.Serve({0x1065af180?, 0x10734d280?}, 0x1400011d0e0, {{0x105d84154?, 0x5?}, 0x9e?, 0x45?})
        github.com/hashicorp/[email protected]/providerserver/providerserver.go:114 +0x258
main.main()
        github.com/airbytehq/terraform-provider-airbyte/main.go:37 +0x13c

goroutine 18 [select]:
github.com/hashicorp/go-plugin.(*gRPCBrokerServer).Recv(0x0?)
        github.com/hashicorp/[email protected]/grpc_broker.go:128 +0x58
github.com/hashicorp/go-plugin.(*GRPCBroker).Run(0x14000316000)
        github.com/hashicorp/[email protected]/grpc_broker.go:582 +0x50
created by github.com/hashicorp/go-plugin.(*GRPCServer).Init in goroutine 1
        github.com/hashicorp/[email protected]/grpc_server.go:91 +0x49c

goroutine 19 [IO wait]:
internal/poll.runtime_pollWait(0x10777b850, 0x72)
        runtime/netpoll.go:345 +0xa0
internal/poll.(*pollDesc).wait(0x1400030e300?, 0x140000b2000?, 0x1)
        internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x1400030e300, {0x140000b2000, 0x1000, 0x1000})
        internal/poll/fd_unix.go:164 +0x200
os.(*File).read(...)
        os/file_posix.go:29
os.(*File).Read(0x1400011a800, {0x140000b2000?, 0x400?, 0x1061f5600?})
        os/file.go:118 +0x70
bufio.(*Reader).Read(0x14000080f10, {0x140000b4000, 0x400, 0x0?})
        bufio/bufio.go:241 +0x1b4
github.com/hashicorp/go-plugin.copyChan({0x1065c5158, 0x140001e2d20}, 0x1400010e9c0, {0x1065a52d8, 0x1400011a800?})
        github.com/hashicorp/[email protected]/grpc_stdio.go:184 +0x14c
created by github.com/hashicorp/go-plugin.newGRPCStdioServer in goroutine 1
        github.com/hashicorp/[email protected]/grpc_stdio.go:40 +0xc8

goroutine 20 [IO wait]:
internal/poll.runtime_pollWait(0x10777b660, 0x72)
        runtime/netpoll.go:345 +0xa0
internal/poll.(*pollDesc).wait(0x1400030e3c0?, 0x14000382000?, 0x1)
        internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x1400030e3c0, {0x14000382000, 0x1000, 0x1000})
        internal/poll/fd_unix.go:164 +0x200
os.(*File).read(...)
        os/file_posix.go:29
os.(*File).Read(0x1400011a810, {0x14000382000?, 0x400?, 0x1061f5600?})
        os/file.go:118 +0x70
bufio.(*Reader).Read(0x14000081710, {0x14000384000, 0x400, 0x0?})
        bufio/bufio.go:241 +0x1b4
github.com/hashicorp/go-plugin.copyChan({0x1065c5158, 0x140001e2d20}, 0x1400010ea20, {0x1065a52d8, 0x1400011a810?})
        github.com/hashicorp/[email protected]/grpc_stdio.go:184 +0x14c
created by github.com/hashicorp/go-plugin.newGRPCStdioServer in goroutine 1
        github.com/hashicorp/[email protected]/grpc_stdio.go:41 +0x138

goroutine 22 [syscall]:
os/signal.signal_recv()
        runtime/sigqueue.go:149 +0x2c
os/signal.loop()
        os/signal/signal_unix.go:23 +0x1c
created by os/signal.Notify.func1.1 in goroutine 1
        os/signal/signal.go:151 +0x28

goroutine 23 [chan receive]:
github.com/hashicorp/go-plugin.Serve.func3()
        github.com/hashicorp/[email protected]/server.go:468 +0x74
created by github.com/hashicorp/go-plugin.Serve in goroutine 1
        github.com/hashicorp/[email protected]/server.go:465 +0xff0

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

mhw avatar Sep 18 '24 08:09 mhw