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

Fix InvalidArgument: Invalid attribute name specified errors listing S3 Bucket objects #32317

Merged
merged 4 commits into from
Jun 30, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jun 30, 2023

Description

Upgrade to AWS SDK for Go v1.44.293, pulling in aws/aws-sdk-go#4898, fixing InvalidArgument: Invalid attribute name specified errors when listing S3 Bucket objects.

Relations

Closes #32307.
Relates #32305.

References

Output from Acceptance Testing

Before

% make testacc TESTARGS='-run=TestAccS3Bucket_Basic_forceDestroy' PKG=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20  -run=TestAccS3Bucket_Basic_forceDestroy -timeout 180m
=== RUN   TestAccS3Bucket_Basic_forceDestroy
=== PAUSE TestAccS3Bucket_Basic_forceDestroy
=== RUN   TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== RUN   TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== CONT  TestAccS3Bucket_Basic_forceDestroy
=== CONT  TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== CONT  TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== NAME  TestAccS3Bucket_Basic_forceDestroy
    testing_new.go:88: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: emptying S3 Bucket (tf-test-bucket-651917069507294545): listing S3 Bucket (tf-test-bucket-651917069507294545) object versions: InvalidArgument: Invalid attribute name specified.
        	status code: 400, request id: G449VFRM31B0KEN5, host id: iVAzEEB0C/FUsr2cTq5O6c+tUHH1Qm18hucAgm1Je2tBTNPXfzdALFcbJ/rIiJWVcjf+Bz3Mo7L6te2ZrZhkBA==
        
--- FAIL: TestAccS3Bucket_Basic_forceDestroy (25.18s)
=== NAME  TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
    testing_new.go:88: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: emptying S3 Bucket (tf-test-bucket-1605337867397239643): listing S3 Bucket (tf-test-bucket-1605337867397239643) object versions: InvalidArgument: Invalid attribute name specified.
        	status code: 400, request id: WKNQCAMCD3S31YZ0, host id: sWQfgZSRTjVQdWcYBcieLLDlBFfJZSl5yvTw3WeYXfBtDz9bE8mC+38iYNub36JS+oPQsV31ed5Iv4aR1RQYQg==
        
--- FAIL: TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes (25.57s)
=== NAME  TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
    testing_new.go:88: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: emptying S3 Bucket (tf-test-bucket-1252849445345403731): listing S3 Bucket (tf-test-bucket-1252849445345403731) object versions: InvalidArgument: Invalid attribute name specified.
        	status code: 400, request id: Q34KWPC5BVCHBV6E, host id: sTtHLTw4jiD7ld76frLtyaCxBEBrkRcGeylh6FAWN+0JzEUVsw7sK/FcN5c3M2o0VXoKZ9bTSyPWVeTbwzmIAg==
        
--- FAIL: TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled (28.52s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/s3	33.600s
FAIL
make: *** [testacc] Error 1

After

% make testacc TESTARGS='-run=TestAccS3Bucket_Basic_forceDestroy' PKG=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20  -run=TestAccS3Bucket_Basic_forceDestroy -timeout 180m
go: downloading github.com/aws/aws-sdk-go v1.44.293
=== RUN   TestAccS3Bucket_Basic_forceDestroy
=== PAUSE TestAccS3Bucket_Basic_forceDestroy
=== RUN   TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== RUN   TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== CONT  TestAccS3Bucket_Basic_forceDestroy
=== CONT  TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== CONT  TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
--- PASS: TestAccS3Bucket_Basic_forceDestroy (28.77s)
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes (28.77s)
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled (32.40s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	38.175s

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.292 to 1.44.293.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](aws/aws-sdk-go@v1.44.292...v1.44.293)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@github-actions
Copy link

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.

@github-actions github-actions bot added the size/XS Managed by automation to categorize the size of a PR. label Jun 30, 2023
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. upstream Addresses functionality related to the cloud provider. service/s3 Issues and PRs that pertain to the s3 service. labels Jun 30, 2023
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

Might be worth a changelog to indicate the fix was made upstream.

$ make testacc PKG=s3 TESTS=TestAccS3Bucket_Basic_forceDestroy
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3Bucket_Basic_forceDestroy'  -timeout 180m

--- PASS: TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes (21.15s)
--- PASS: TestAccS3Bucket_Basic_forceDestroy (21.35s)
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled (24.82s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/s3 28.171s

@github-actions github-actions bot added service/s3 Issues and PRs that pertain to the s3 service. and removed service/s3 Issues and PRs that pertain to the s3 service. labels Jun 30, 2023
@github-actions github-actions bot removed the service/s3 Issues and PRs that pertain to the s3 service. label Jun 30, 2023
@ewbankkit
Copy link
Contributor Author

Blame added: https://github.com/hashicorp/terraform-provider-aws/pull/32317/files#diff-b20551d9ba5cf72c70f83c7a98d8e53a1d08f4a3d4a859b7c4771b4184d9510dR2

@ewbankkit ewbankkit added this to the v5.6.2 milestone Jun 30, 2023
@ewbankkit ewbankkit merged commit 89781ed into main Jun 30, 2023
@ewbankkit ewbankkit deleted the b-s3-list-error branch June 30, 2023 15:04
github-actions bot pushed a commit that referenced this pull request Jun 30, 2023
@github-actions
Copy link

This functionality has been released in v5.6.2 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 Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. size/XS Managed by automation to categorize the size of a PR. upstream Addresses functionality related to the cloud provider.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Error emptying S3 Bucket when objects are in it, even though force-destroy is enabled.
2 participants