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

r/aws_s3_bucket.logging: Fix panic: interface conversion: interface {} is nil, not map[string]interface {} #29243

Merged
merged 2 commits into from
Feb 3, 2023

Conversation

ewbankkit
Copy link
Contributor

Description

Fixes a reported crash (v4.49.0):

Error: The terraform-provider-aws_v4.49.0_x5 plugin crashed!

Stack trace from the terraform-provider-aws_v4.49.0_x5 plugin:

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

goroutine 406 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/s3.resourceBucketInternalLoggingUpdate(0xc0010a01e0, 0xc000da8c80)
github.com/hashicorp/terraform-provider-aws/internal/service/s3/bucket.go:1889 +0x41f
github.com/hashicorp/terraform-provider-aws/internal/service/s3.resourceBucketUpdate(0xc000da8c80, {0xca6d140?, 0xc0003b7800})
github.com/hashicorp/terraform-provider-aws/internal/service/s3/bucket.go:874 +0x129d
github.com/hashicorp/terraform-provider-aws/internal/service/s3.resourceBucketCreate(0x0?, {0xca6d140?, 0xc0003b7800})
github.com/hashicorp/terraform-provider-aws/internal/service/s3/bucket.go:805 +0xa65
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xddadaa0?, {0xddadaa0?, 0xc003d32de0?}, 0xd?, {0xca6d140?, 0xc0003b7800?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000f02000, {0xddadaa0, 0xc003d32de0}, 0xc002c36a90, 0xc000da8b00, {0xca6d140, 0xc0003b7800})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0002040a8, {0xddadaa0?, 0xc003d32b40?}, 0xc001013f90)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ApplyResourceChange({0xc00314be90, 0xc00314bef0, {0xc003908ea0, 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(0xc001c0f900, {0xddadaa0?, 0xc003d1ea80?}, 0xc001c06230)
github.com/hashicorp/terraform-plugin-go@v0.14.2/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xc790420?, 0xc001c0f900}, {0xddadaa0, 0xc003d1ea80}, 0xc001c061c0, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.14.2/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0035efc20, {0xddbc400, 0xc004546000}, 0xc003fcb440, 0xc0043e7d70, 0x1429d0e0, 0x0)
google.golang.org/grpc@v1.51.0/server.go:1340 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc0035efc20, {0xddbc400, 0xc004546000}, 0xc003fcb440, 0x0)
google.golang.org/grpc@v1.51.0/server.go:1713 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/grpc@v1.51.0/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.51.0/server.go:963 +0x28a

Error: The terraform-provider-aws_v4.49.0_x5 plugin crashed!

Relations

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccS3Bucket_Security_logging' PKG=s3 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 3  -run=TestAccS3Bucket_Security_logging -timeout 180m
=== RUN   TestAccS3Bucket_Security_logging
=== PAUSE TestAccS3Bucket_Security_logging
=== CONT  TestAccS3Bucket_Security_logging
--- PASS: TestAccS3Bucket_Security_logging (26.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	31.634s

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@ewbankkit ewbankkit changed the title r/aws_s3_bucket.logging: Prevent crash panic: interface conversion: interface {} is nil, not map[string]interface {} r/aws_s3_bucket.logging: Fix panic: interface conversion: interface {} is nil, not map[string]interface {} Feb 3, 2023
@github-actions github-actions bot added service/s3 Issues and PRs that pertain to the s3 service. size/XS Managed by automation to categorize the size of a PR. labels Feb 3, 2023
@ewbankkit ewbankkit merged commit 9f760a4 into main Feb 3, 2023
@ewbankkit ewbankkit deleted the b-aws_s3_bucket.logging-nil branch February 3, 2023 20:00
@github-actions github-actions bot added this to the v4.54.0 milestone Feb 3, 2023
github-actions bot pushed a commit that referenced this pull request Feb 3, 2023
@github-actions
Copy link

github-actions bot commented Feb 9, 2023

This functionality has been released in v4.54.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/s3 Issues and PRs that pertain to the s3 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant