hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.81k stars 9.16k forks source link

[Bug]: Error: The terraform-provider-aws_v5.72.1_x5 plugin crashed! #39823

Open ysa-v opened 4 days ago

ysa-v commented 4 days ago

Terraform Core Version

1.9.8

AWS Provider Version

5.72.1

Affected Resource(s)

aws_cognito_user_pool aws_s3_object aws_dynamodb_table_item

Expected Behavior

Expected terraform apply to run successfully and deploy resources, instead received an error.

Actual Behavior

Plugin crashed on apply while creating resources listed above.

Relevant Error/Panic Output Snippet


Error: Plugin did not respond

  with module.<redacted>.aws_cognito_user_pool.<redacted>,
  on .terraform/modules/<redacted>/main.tf line 4, in resource "aws_cognito_user_pool" "<redacted>":
   4: resource "aws_cognito_user_pool" "<redacted>" {

The plugin encountered an error, and failed to respond to the
plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain
more details.

Error: Plugin did not respond

  with module.<redacted>.module.<redacted>.aws_s3_object.lambda,
  on .terraform/modules/<redacted>.<redacted>/main.tf line 6, in resource "aws_s3_object" "lambda":
   6: resource "aws_s3_object" "lambda" {

The plugin encountered an error, and failed to respond to the
plugin.(*GRPCProvider).ValidateResourceConfig call. The plugin logs may
contain more details.

Error: Request cancelled

  with module.<redacted>.aws_dynamodb_table_item.<redacted>,
  on .terraform/modules/<redacted>/scripts/<redacted>.tf line 73, in resource "aws_dynamodb_table_item" "<redacted>":
  73: resource "aws_dynamodb_table_item" "<redacted>" {

The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.

Stack trace from the terraform-provider-aws_v5.72.1_x5 plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

    github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource_data.go:504 +0x6a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.diffSet(0xc004d8d170, {0x1af8b688, 0xc004cd6cc0}, {0x18ba70d9, 0x6}, 0xc004dd1680, 0xc0014db010, {0x1afde300, 0xc004dc6280}, 0x0)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/schema.go:1412 +0x74
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.diff(0xc004d8d170, {0x1af8b688, 0xc004cd6cc0}, {0x18ba70d9, 0x6}, 0xc004dd1680, 0xc004dc6200, {0x1afde300, 0xc004dc6280}, 0x0)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/schema.go:1134 +0x25a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc004d8d170, {0x1af8b688, 0xc004cd6cc0}, 0xc004dd2d00, 0xc004e0b900, 0x0, {0x0, 0x0}, 0x0)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/schema.go:678 +0x332
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.diffFromValues({0x1af8b688, 0xc004cd6cc0}, {{{0x1af8ba48?, 0xc004bb1468?}}, {0x16ef5120?, 0xc004ced740?}}, {{{0x1af8ba48, 0xc004bb1588}}, {0x16ef5120, 0xc004d80990}}, ...)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/shims.go:46 +0x265
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.DiffFromValues(...)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/shims.go:23
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0031cd758, {0x1af8b688?, 0xc004cd6c00?}, 0xc004b6fc70)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/grpc_provider.go:1093 +0x67a
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0xc000c4b9d0, {0x1af8b688?, 0xc004cd6930?}, 0xc004b6fc70)
    github.com/hashicorp/terraform-plugin-mux@v0.16.0/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc001917360, {0x1af8b688?, 0xc004cd6150?}, 0xc0008fa3f0)
    github.com/hashicorp/terraform-plugin-go@v0.24.0/tfprotov5/tf5server/server.go:865 +0x3bc
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x189cdba0, 0xc001917360}, {0x1af8b688, 0xc004cd6150}, 0xc00499da00, 0x0)
    github.com/hashicorp/terraform-plugin-go@v0.24.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:545 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc002f58a00, {0x1af8b688, 0xc004cd60c0}, {0x1b005b00, 0xc00106eb60}, 0xc004c919e0, 0xc00125ac30, 0x2596f538, 0x0)
    google.golang.org/grpc@v1.66.2/server.go:1394 +0xe2b
google.golang.org/grpc.(*Server).handleStream(0xc002f58a00, {0x1b005b00, 0xc00106eb60}, 0xc004c919e0)
    google.golang.org/grpc@v1.66.2/server.go:1805 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
    google.golang.org/grpc@v1.66.2/server.go:1029 +0x7f
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 8
    google.golang.org/grpc@v1.66.2/server.go:1040 +0x125

Error: The terraform-provider-aws_v5.72.1_x5 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.

Terraform Configuration Files

terraform {
  backend "azurerm" {
  }

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "~> 4.0"
    }
  }
}

Steps to Reproduce

terraform init terraform plan terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 4 days ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 4 days ago

Hey @ysa-v 👋 Thank you for taking the time to raise this! Are you able to supply a sample configuration that can be used to reproduce this and/or more complete debug logging (redacted as needed)? As it stands, I'm not sure there's enough information here for whoever picks this up to look into this.

ysa-v commented 3 days ago

Hey @ysa-v 👋 Thank you for taking the time to raise this! Are you able to supply a sample configuration that can be used to reproduce this and/or more complete debug logging (redacted as needed)? As it stands, I'm not sure there's enough information here for whoever picks this up to look into this.

Thanks! I added some more of the log info to the Relevant Error/Panic Output Snippet above. Let me know if more information is needed.