Skip to content

Crash in latest version of the plugin 7.11.0 "fatal error: concurrent map writes" #720

@paul-civitas

Description

@paul-civitas

My code:

resource "argocd_project_token" "argo_token" {
  for_each = toset(keys(local.env))
  project  = "prefix-${each.key}"
  role     = "yada"
}

resource "aws_secretsmanager_secret" "argo_token" {
  for_each = toset(keys(local.env))
  name     = "yada/${each.key}/yada/argocd-token"
}

resource "aws_secretsmanager_secret_version" "argo_token" {
  for_each      = aws_secretsmanager_secret.argo_token
  secret_id     = each.value.id
  secret_string = argocd_project_token.argo_token[each.key].jwt
}

Logs:

│ Error: Plugin did not respond
│
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
fatal error: concurrent map writes

goroutine 222 [running]:
internal/runtime/maps.fatal({0x103cb7421?, 0x100d5cbe8?})
        runtime/panic.go:1058 +0x20
github.com/argoproj-labs/terraform-provider-argocd/argocd.resourceArgoCDProjectTokenRead({0x105556bd0, 0x14000761810}, 0x14001566100, {0x10519dce0?, 0x14000668788})
        github.com/argoproj-labs/terraform-provider-argocd/argocd/resource_argocd_project_token.go:283 +0xd8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x140010e6c00, {0x105556b28, 0x140014cf6e0}, 0x14001566100, {0x10519dce0, 0x14000668788})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.36.1/helper/schema/resource.go:855 +0xe4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0x140010e6c00, {0x105556b28, 0x140014cf6e0}, 0x14001554f70, {0x10519dce0, 0x14000668788})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.36.1/helper/schema/resource.go:1149 +0x40c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0x14000b12018, {0x105556b28?, 0x140014cf2c0?}, 0x140002a3540)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.36.1/helper/schema/grpc_provider.go:739 +0x5b0
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ReadResource({{0x105587f50?, 0x14000b12018?}}, {0x105556b28?, 0x140014cf2c0?}, 0x140002a3400?)
        github.com/hashicorp/terraform-plugin-mux@v0.18.0/tf5to6server/tf5to6server.go:175 +0x284
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ReadResource(0x140007d5e00, {0x105556b28?, 0x140014cea20?}, 0x140002a3400)
        github.com/hashicorp/terraform-plugin-mux@v0.18.0/tf6muxserver/mux_server_ReadResource.go:35 +0x17c
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadResource(0x14000ad1220, {0x105556b28?, 0x140014b5170?}, 0x140007608c0)
        github.com/hashicorp/terraform-plugin-go@v0.26.0/tfprotov6/tf6server/server.go:785 +0x210
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadResource_Handler({0x1053b5060, 0x14000ad1220}, {0x105556b28, 0x140014b5170}, 0x14001517d80, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.26.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:575 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x14000348400, {0x105556b28, 0x140014b4f60}, 0x14000e98f60, 0x1400119e960, 0x107ad7428, 0x0)
        google.golang.org/grpc@v1.71.0/server.go:1405 +0xc9c
google.golang.org/grpc.(*Server).handleStream(0x14000348400, {0x105557650, 0x1400124e000}, 0x14000e98f60)
        google.golang.org/grpc@v1.71.0/server.go:1815 +0x900
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/grpc@v1.71.0/server.go:1035 +0x84
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 45
        google.golang.org/grpc@v1.71.0/server.go:1046 +0x138
goroutine 1 [select]:
github.com/hashicorp/go-plugin.Serve(0x14000dc8ae0)
        github.com/hashicorp/go-plugin@v1.6.2/server.go:503 +0x11b0
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.Serve({0x103d2796b, 0x2a}, 0x14001161ba0, {0x0, 0x0, 0x0})
        github.com/hashicorp/terraform-plugin-go@v0.26.0/tfprotov6/tf6server/server.go:316 +0x948
main.main()
        github.com/argoproj-labs/terraform-provider-argocd/main.go:73 +0x2b8

goroutine 5 [select]:
github.com/desertbit/timer.timerRoutine()
        github.com/desertbit/timer@v0.0.0-20180107155436-c41aec40b27f/timers.go:119 +0x98
created by github.com/desertbit/timer.init.0 in goroutine 1
        github.com/desertbit/timer@v0.0.0-20180107155436-c41aec40b27f/timers.go:15 +0x24

goroutine 65 [select]:
github.com/hashicorp/go-plugin.(*gRPCBrokerServer).Recv(0x14000a08660?)
        github.com/hashicorp/go-plugin@v1.6.2/grpc_broker.go:128 +0x58
github.com/hashicorp/go-plugin.(*GRPCBroker).Run(0x14000848840)
        github.com/hashicorp/go-plugin@v1.6.2/grpc_broker.go:585 +0x4c
created by github.com/hashicorp/go-plugin.(*GRPCServer).Init in goroutine 1
        github.com/hashicorp/go-plugin@v1.6.2/grpc_server.go:91 +0x49c

goroutine 24 [select]:
github.com/patrickmn/go-cache.(*janitor).Run(0x140006d7220, 0x14000b14840)
        github.com/patrickmn/go-cache@v2.1.0+incompatible/cache.go:1079 +0x74
created by github.com/patrickmn/go-cache.runJanitor in goroutine 1
        github.com/patrickmn/go-cache@v2.1.0+incompatible/cache.go:1099 +0xe8

goroutine 66 [IO wait]:
internal/poll.runtime_pollWait(0x14f1d0dc8, 0x72)
        runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x14000dc90e0?, 0x140009e8000?, 0x1)
        internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x14000dc90e0, {0x140009e8000, 0x1000, 0x1000})
        internal/poll/fd_unix.go:165 +0x1fc
os.(*File).read(...)
        os/file_posix.go:29
os.(*File).Read(0x14000692e08, {0x140009e8000?, 0x400?, 0x104b25300?})
        os/file.go:124 +0x6c
bufio.(*Reader).Read(0x14000211f10, {0x140012b8c00, 0x400, 0x0?})
        bufio/bufio.go:245 +0x1b0
github.com/hashicorp/go-plugin.copyChan({0x105587de0, 0x1400064c6c0}, 0x14000b9eee0, {0x105513dc0, 0x14000692e08?})
        github.com/hashicorp/go-plugin@v1.6.2/grpc_stdio.go:184 +0x14c
created by github.com/hashicorp/go-plugin.newGRPCStdioServer in goroutine 1
        github.com/hashicorp/go-plugin@v1.6.2/grpc_stdio.go:40 +0xc8
goroutine 67 [IO wait]:
internal/poll.runtime_pollWait(0x14f1d0b98, 0x72)
        runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x14000dc91a0?, 0x140003ae000?, 0x1)
        internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x14000dc91a0, {0x140003ae000, 0x1000, 0x1000})
        internal/poll/fd_unix.go:165 +0x1fc
os.(*File).read(...)
        os/file_posix.go:29
os.(*File).Read(0x14000692e18, {0x140003ae000?, 0x400?, 0x104b25300?})
        os/file.go:124 +0x6c
bufio.(*Reader).Read(0x14000212710, {0x14000181400, 0x400, 0x0?})
        bufio/bufio.go:245 +0x1b0
github.com/hashicorp/go-plugin.copyChan({0x105587de0, 0x1400064c6c0}, 0x14000b9ef50, {0x105513dc0, 0x14000692e18?})
        github.com/hashicorp/go-plugin@v1.6.2/grpc_stdio.go:184 +0x14c
created by github.com/hashicorp/go-plugin.newGRPCStdioServer in goroutine 1
        github.com/hashicorp/go-plugin@v1.6.2/grpc_stdio.go:41 +0x138

goroutine 39 [syscall]:
os/signal.signal_recv()
        runtime/sigqueue.go:149 +0x2c

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingon-holdIssues or Pull Requests with this label will never be considered stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions