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

Plugin crashed while creating a few hundred users #2292

Closed
agadzik opened this issue Feb 24, 2024 · 1 comment · Fixed by #2302
Closed

Plugin crashed while creating a few hundred users #2292

agadzik opened this issue Feb 24, 2024 · 1 comment · Fixed by #2302
Labels

Comments

@agadzik
Copy link

agadzik commented Feb 24, 2024

Datadog Terraform Provider Version

3.36.1

Terraform Version

1.7.4

What resources or data sources are affected?

datadog_user

Terraform Configuration Files

# Create Datadog users
resource "datadog_user" "users" {
  # `source` comes from an external file
  for_each = local.source.users

  name  = each.value.name
  email = each.value.email
}

Relevant debug or panic output

Stack trace from the terraform-provider-datadog_v3.36.1 plugin:

panic: runtime error: index out of range [0] with length 0

goroutine 42 [running]:
github.com/terraform-providers/terraform-provider-datadog/datadog.resourceDatadogUserCreate({0x1b88080?, 0xc000a39aa0?}, 0x0?, {0x15154e0?, 0xc000a4a1e0})
github.com/terraform-providers/terraform-provider-datadog/datadog/resource_datadog_user.go:198 +0xdbb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc000315340, {0x1b88080, 0xc000a39aa0}, 0xd?, {0x15154e0, 0xc000a4a1e0})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:733 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000315340, {0x1b88080, 0xc000a39aa0}, 0xc000ad6000, 0xc00041aa00, {0x15154e0, 0xc000a4a1e0})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:864 +0xa7e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000352738, {0x1b88080?, 0xc000a39950?}, 0xc000897860)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/grpc_provider.go:1024 +0xe8d
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ApplyResourceChange({0xc00023bdd0, 0xc00023be30, {0xc000794d60, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...)
github.com/hashicorp/terraform-plugin-mux@v0.8.0/tf5muxserver/mux_server_ApplyResourceChange.go:27 +0x102
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc000748460, {0x1b88080?, 0xc000a4b440?}, 0xc0000c62a0)
github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/tf5server/server.go:821 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x182e020?, 0xc000748460}, {0x1b88080, 0xc000a4b440}, 0xc0000c6230, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:422 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0004521e0, {0x1b8d960, 0xc000706d00}, 0xc000334fc0, 0xc00078de30, 0x28d2d00, 0x0)
google.golang.org/grpc@v1.56.3/server.go:1335 +0xdf3
google.golang.org/grpc.(*Server).handleStream(0xc0004521e0, {0x1b8d960, 0xc000706d00}, 0xc000334fc0, 0x0)
google.golang.org/grpc@v1.56.3/server.go:1712 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/grpc@v1.56.3/server.go:947 +0xca
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.56.3/server.go:958 +0x15c

Error: The terraform-provider-datadog_v3.36.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.

Operation failed: failed running terraform apply (exit 1)�

Expected Behavior

Plugin shouldn't crash

Actual Behavior

Plugin crashed

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

@skarimo
Copy link
Member

skarimo commented Feb 29, 2024

Thanks for the report! I put up #2302 to ensure we don't panic when no results are found. However, as a followup, is it possible you are creating multiple users using the same email?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants