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.74k stars 9.1k forks source link

[Bug]: Error: The terraform-provider-aws_v5.13.1_x5.exe plugin crashed! #33131

Open mostafaDashtiGrohe opened 1 year ago

mostafaDashtiGrohe commented 1 year ago

Terraform Core Version

1.5.0

AWS Provider Version

5.13.1

Affected Resource(s)

No response

Expected Behavior

A few resources should be created including VPC, API Gateway, DocumentDB, and Lambda functions. It was working last Friday and now it throws this error out.

Actual Behavior

 Error: Request cancelled
│
│   with aws_api_gateway_resource.authorizer_api,
│   on api-endpoints.tf line 3, in resource "aws_api_gateway_resource" "authorizer_api":
│    3: resource "aws_api_gateway_resource" "authorizer_api" {
│
│ The plugin.(*GRPCProvider).ValidateResourceConfig request was cancelled.

Relevant Error/Panic Output Snippet

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

panic: unaligned 64-bit atomic operation

goroutine 422 [running]:
runtime/internal/atomic.panicUnaligned()
        runtime/internal/atomic/unaligned.go:8 +0x2d
runtime/internal/atomic.Xadd64(0x1ec8c31c, 0x1)
        runtime/internal/atomic/atomic_386.s:125 +0x11
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery.(*EndpointCache).Add(0x1ec8c300, {{0x21af8f00, 0x16}, {0x1e46a720, 0x1, 0x1}})
        github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery@v1.7.33/cache.go:76 +0xd1
github.com/aws/aws-sdk-go-v2/service/timestreamwrite.(*Client).handleEndpointDiscoveryFromService(0x1d0f6dd0, {0xd4765e0, 0x1e619278}, 
0x13370638, {0x21af8f00, 0x16}, {{0x0, 0x0}, 0x0, {0xd42d0fc, ...}})
        github.com/aws/aws-sdk-go-v2/service/timestreamwrite@v1.18.3/api_client.go:601 +0x52d
github.com/aws/aws-sdk-go-v2/service/timestreamwrite.(*Client).fetchOpCreateDatabaseDiscoverEndpoint(0x1d0f6dd0, {0xd4765e0, 0x1e619278}, {0xae00460, 0x1e619080}, {0x1e653f40, 0x1, 0x1})
        github.com/aws/aws-sdk-go-v2/service/timestreamwrite@v1.18.3/api_op_CreateDatabase.go:186 +0x246
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery.(*DiscoverEndpoint).HandleSerialize(0x1e6190e0, {0xd4765e0, 0x1e619278}, {{0xae00460, 0x1e619080}, {0xc172140, 0x1e619218}}, {0xd42cfa8, 0x1e65ed40})
        github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery@v1.7.33/middleware.go:86 +0x1e4
github.com/aws/smithy-go/middleware.decoratedSerializeHandler.HandleSerialize(...)
        github.com/aws/smithy-go@v1.14.1/middleware/step_serialize.go:208
github.com/aws/aws-sdk-go-v2/service/timestreamwrite.(*opCreateDatabaseResolveEndpointMiddleware).HandleSerialize(0x1e65ec60, {0xd4765e0, 0x1e619200}, {{0xae00460, 0x1e619080}, {0xc172140, 0x1e619218}}, {0xd42cfa8, 0x1e65ed50})
        github.com/aws/aws-sdk-go-v2/service/timestreamwrite@v1.18.3/api_op_CreateDatabase.go:315 +0xd2b
github.com/aws/smithy-go/middleware.decoratedSerializeHandler.HandleSerialize(...)
        github.com/aws/smithy-go@v1.14.1/middleware/step_serialize.go:208
github.com/aws/aws-sdk-go-v2/service/timestreamwrite.(*ResolveEndpoint).HandleSerialize(0x1ec8c420, {0xd4765e0, 0x1e619200}, {{0xae00460, 0x1e619080}, {0xc172140, 0x1e619218}}, {0xd42cfa8, 0x1e65ed60})
        github.com/aws/aws-sdk-go-v2/service/timestreamwrite@v1.18.3/endpoints.go:80 +0x8dd
github.com/aws/smithy-go/middleware.decoratedSerializeHandler.HandleSerialize(...)
        github.com/aws/smithy-go@v1.14.1/middleware/step_serialize.go:208
github.com/aws/smithy-go/middleware.(*SerializeStep).HandleMiddleware(0x1e653ef0, {0xd4765e0, 0x1e619200}, {0xae00460, 0x1e619080}, {0xd42cf80, 0x1e65ecc0})
        github.com/aws/smithy-go@v1.14.1/middleware/step_serialize.go:122 +0x230
github.com/aws/smithy-go/middleware.decoratedHandler.Handle(...)
        github.com/aws/smithy-go@v1.14.1/middleware/middleware.go:57
github.com/aws/smithy-go/middleware.initializeWrapHandler.HandleInitialize(...)
        github.com/aws/smithy-go@v1.14.1/middleware/step_initialize.go:184
github.com/aws/aws-sdk-go-v2/service/timestreamwrite.(*validateOpCreateDatabase).HandleInitialize(0x13370638, {0xd4765e0, 0x1e619200}, 
{{0xae00460, 0x1e619080}}, {0xd42cfe4, 0x1e653f60})
        github.com/aws/aws-sdk-go-v2/service/timestreamwrite@v1.18.3/validators.go:50 +0xa4
github.com/aws/smithy-go/middleware.decoratedInitializeHandler.HandleInitialize(...)
        github.com/aws/smithy-go@v1.14.1/middleware/step_initialize.go:200
github.com/aws/smithy-go/middleware.(*setLogger).HandleInitialize(0x1e653f30, {0xd4765e0, 0x1e6191e8}, {{0xae00460, 0x1e619080}}, {0xd42cf94, 0x1e65ecf0})
        github.com/aws/smithy-go@v1.14.1/middleware/logging.go:45 +0x89
github.com/aws/smithy-go/middleware.decoratedInitializeHandler.HandleInitialize(...)
        github.com/aws/smithy-go@v1.14.1/middleware/step_initialize.go:200
github.com/aws/aws-sdk-go-v2/service/timestreamwrite.(*legacyEndpointContextSetter).HandleInitialize(0x1e653f28, {0xd4765e0, 0x1e6191e8}, {{0xae00460, 0x1e619080}}, {0xd42cf94, 0x1e65ed00})
        github.com/aws/aws-sdk-go-v2/service/timestreamwrite@v1.18.3/api_client.go:266 +0x9a
github.com/aws/smithy-go/middleware.decoratedInitializeHandler.HandleInitialize(...)
        github.com/aws/smithy-go@v1.14.1/middleware/step_initialize.go:200
github.com/aws/aws-sdk-go-v2/aws/middleware.RegisterServiceMetadata.HandleInitialize({{0xc2a3c80, 0x10}, {0xc26f8a2, 0xa}, {0x1e4fcf96, 0x9}, {0xc28959f, 0xe}}, {0xd4765e0, 0x1e619098}, ...)
        github.com/aws/aws-sdk-go-v2@v1.20.2/aws/middleware/metadata.go:41 +0x1ce
github.com/aws/smithy-go/middleware.decoratedInitializeHandler.HandleInitialize(...)
        github.com/aws/smithy-go@v1.14.1/middleware/step_initialize.go:200
github.com/aws/smithy-go/middleware.(*InitializeStep).HandleMiddleware(0x1e653ee0, {0xd4765e0, 0x1e619098}, {0xae00460, 0x1e619080}, {0xd42cf80, 0x1e65ecd0})
        github.com/aws/smithy-go@v1.14.1/middleware/step_initialize.go:114 +0x205
github.com/aws/smithy-go/middleware.decoratedHandler.Handle(...)
        github.com/aws/smithy-go@v1.14.1/middleware/middleware.go:57
github.com/aws/smithy-go/middleware.(*Stack).HandleMiddleware(0x1e662800, {0xd4765e0, 0x1e619098}, {0xae00460, 0x1e619080}, {0xd42d00c, 0x1e653f58})
        github.com/aws/smithy-go@v1.14.1/middleware/stack.go:109 +0x123
github.com/aws/smithy-go/middleware.decoratedHandler.Handle(...)
        github.com/aws/smithy-go@v1.14.1/middleware/middleware.go:57
github.com/aws/aws-sdk-go-v2/service/timestreamwrite.(*Client).invokeOperation(0x1d0f6dd0, {0xd4765e0, 0x1e618fc0}, {0xc28959f, 0xe}, {0xae00460, 0x1e619080}, {0x0, 0x0, 0x0}, ...)
        github.com/aws/aws-sdk-go-v2/service/timestreamwrite@v1.18.3/api_client.go:238 +0x629
github.com/aws/aws-sdk-go-v2/service/timestreamwrite.(*Client).CreateDatabase(0x1d0f6dd0, {0xd4765e0, 0x1e618fc0}, 0x1e619080, {0x0, 0x0, 0x0})
        github.com/aws/aws-sdk-go-v2/service/timestreamwrite@v1.18.3/api_op_CreateDatabase.go:31 +0xcd
github.com/hashicorp/terraform-provider-aws/internal/service/timestreamwrite.resourceDatabaseCreate({0xd4765e0, 0x1e618fc0}, 0x1e626e60, {0xc1f7d60, 0x1e39a0e0})
        github.com/hashicorp/terraform-provider-aws/internal/service/timestreamwrite/database.go:88 +0x220
github.com/hashicorp/terraform-provider-aws/internal/provider.interceptedHandler[...].func1(0x1e626e60, {0xc1f7d60, 0x1e39a0e0})       
        github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:111 +0x360
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x1e2a7730, {0xd4765e0, 0x1e618df8}, 0x1e626e60, {0xc1f7d60, 0x1e39a0e0})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:728 +0x80
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x1e2a7730, {0xd4765e0, 0x1e618df8}, 0x1ddf55e0, 0x1e626d70, {0xc1f7d60, 0x1e39a0e0})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:864 +0xab4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x1e2dddf0, {0xd4765e0, 0x1e618d98}, 0x1f5c1f80)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/grpc_provider.go:1024 +0xfa4
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ApplyResourceChange({0x1e3927e0, 0x1ea65590, 0x1e392800, 0x1e392820, {0x1e2dde00, 0x2, 0x2}}, {0xd4765e0, 0x1e618ca8}, 0x1f5c1f80)
        github.com/hashicorp/terraform-plugin-mux@v0.11.2/tf5muxserver/mux_server_ApplyResourceChange.go:30 +0x145
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x1e382870, {0xd4765e0, 0x1e6189f0}, 0x1d6a53c0)
        github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/tf5server/server.go:821 +0x583
xd4765e0, 0x1e6189f0}, 0x1d6a5380, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:422 +0x18a
google.golang.org/grpc.(*Server).processUnaryRPC(0x1d0cc5a0, {0xd47c8fc, 0x1db2e000}, 0x1e632fa0, 0x1e41e2a0, 0x13336ca0, 0x0)
        google.golang.org/grpc@v1.57.0/server.go:1360 +0xee6
google.golang.org/grpc.(*Server).handleStream(0x1d0cc5a0, {0xd47c8fc, 0x1db2e000}, 0x1e632fa0, 0x0)
        google.golang.org/grpc@v1.57.0/server.go:1737 +0xa1e
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/grpc@v1.57.0/server.go:982 +0xb1
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.57.0/server.go:980 +0x178

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

resource "aws_api_gateway_resource" "authorizer_api" {
  rest_api_id = module.api_gateway.api_id
  parent_id   = module.api_gateway.api_root_resource_id
  path_part   = "Authentication"
}

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 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

ewbankkit commented 1 year ago

@mostafaDashtiGrohe Thanks for raising this issue 👏. Which operating system are you running Terraform on?

mostafaDashtiGrohe commented 1 year ago

@ewbankkit Thanks for following up on this issue, I'm using Visual Studio Code on Windows 10 Version 10.0.19044 Build 19044

mostafaDashtiGrohe commented 1 year ago

Hi @ewbankkit , I noticed that the problem is related to the Timestream resource. When I removed that part of my code it deployed successfully on AWS. Here is how I used it: resource "aws_timestreamwrite_database" "timestream_db" { database_name = var.database_name tags = var.resource_tags } FYI, I also tried to use "5.12.0" and "5.13.0" and I faced the same problem.

mostafaDashtiGrohe commented 1 year ago

Hi @ewbankkit , Is there any update regarding this issue?

mostafaDashtiGrohe commented 12 months ago

?