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

resource_aws_s3_bucket.go: retry NoSuchBucket when updating tags for s3 bucket #12418

Merged
merged 1 commit into from
Mar 17, 2020

Conversation

abhinavdahiya
Copy link
Contributor

Community Note

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

Release note for CHANGELOG:

resource_aws_s3_bucket.go: retry NoSuchBucket when updating tags for s3 bucket

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

The original retry was added in pr-108836 but, in later refactor the retry was dropped pr-11916

the causes failures like

level=error msg="Error: error updating S3 Bucket (terraform-20200316104552904700000001) tags: error listing resource tags (terraform-20200316104552904700000001): NoSuchBucket: The specified bucket does not exist"
level=error msg="\tstatus code: 404, request id: <REDACTED>, host id: <REDACTED>"
level=error
level=error msg="  on ../tmp/openshift-install-019032273/bootstrap/main.tf line 7, in resource \"aws_s3_bucket\" \"ignition\":"
level=error msg="   7: resource \"aws_s3_bucket\" \"ignition\" {"
level=error
level=error

debug error:

time="2020-03-16T10:45:53Z" level=debug msg="2020-03-16T10:45:53.413Z [DEBUG] plugin.terraform-provider-aws: [DEBUG] [aws-sdk-go] DEBUG: Validate Response s3/GetBucketTagging failed, attempt 0/25, error NoSuchBucket: The specified bucket does not exist"
time="2020-03-16T10:45:53Z" level=debug msg="2020-03-16T10:45:53.413Z [DEBUG] plugin.terraform-provider-aws: \tstatus code: 404, request id: <REDACTED>, host id: <REDACTED>"
time="2020-03-16T10:45:53Z" level=debug msg="[DEBUG] module.bootstrap.aws_s3_bucket.ignition: apply errored, but we're indicating that via the Error pointer rather than returning it: error updating S3 Bucket (terraform-20200316104552904700000001) tags: error listing resource tags (terraform-20200316104552904700000001): NoSuchBucket: The specified bucket does not exist"

@abhinavdahiya abhinavdahiya requested a review from a team March 16, 2020 22:20
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/s3 Issues and PRs that pertain to the s3 service. labels Mar 16, 2020
…s3 bucket

The original retry was added in [1] but, in later refactor the retry was dropped [2]

the causes failures like

```
level=error msg="Error: error updating S3 Bucket (terraform-20200316104552904700000001) tags: error listing resource tags (terraform-20200316104552904700000001): NoSuchBucket: The specified bucket does not exist"
level=error msg="\tstatus code: 404, request id: <REDACTED>, host id: <REDACTED>"
level=error
level=error msg="  on ../tmp/openshift-install-019032273/bootstrap/main.tf line 7, in resource \"aws_s3_bucket\" \"ignition\":"
level=error msg="   7: resource \"aws_s3_bucket\" \"ignition\" {"
level=error
level=error
```

debug error:
```
time="2020-03-16T10:45:53Z" level=debug msg="2020-03-16T10:45:53.413Z [DEBUG] plugin.terraform-provider-aws: [DEBUG] [aws-sdk-go] DEBUG: Validate Response s3/GetBucketTagging failed, attempt 0/25, error NoSuchBucket: The specified bucket does not exist"
time="2020-03-16T10:45:53Z" level=debug msg="2020-03-16T10:45:53.413Z [DEBUG] plugin.terraform-provider-aws: \tstatus code: 404, request id: <REDACTED>, host id: <REDACTED>"
time="2020-03-16T10:45:53Z" level=debug msg="[DEBUG] module.bootstrap.aws_s3_bucket.ignition: apply errored, but we're indicating that via the Error pointer rather than returning it: error updating S3 Bucket (terraform-20200316104552904700000001) tags: error listing resource tags (terraform-20200316104552904700000001): NoSuchBucket: The specified bucket does not exist"
```

[1]: hashicorp#10863
[2]: hashicorp#11916
@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 17, 2020
@bflad bflad self-assigned this Mar 17, 2020
@bflad bflad added this to the v2.54.0 milestone Mar 17, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this, @abhinavdahiya 🚀

Output from acceptance testing (failures unrelated):

--- FAIL: TestAccAWSS3Bucket_acceleration (10.31s)
--- FAIL: TestAccAWSS3Bucket_LifecycleBasic (22.92s)
--- PASS: TestAccAWSS3Bucket_AclToGrant (24.74s)
--- PASS: TestAccAWSS3Bucket_basic (15.90s)
--- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (15.78s)
--- PASS: TestAccAWSS3Bucket_Cors_Delete (13.81s)
--- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (15.40s)
--- PASS: TestAccAWSS3Bucket_Cors_Update (25.35s)
--- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (25.34s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (16.30s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (34.44s)
--- PASS: TestAccAWSS3Bucket_forceDestroy (11.94s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (11.09s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (12.85s)
--- PASS: TestAccAWSS3Bucket_generatedName (16.61s)
--- PASS: TestAccAWSS3Bucket_GrantToAcl (25.53s)
--- PASS: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (21.66s)
--- PASS: TestAccAWSS3Bucket_Logging (18.80s)
--- PASS: TestAccAWSS3Bucket_namePrefix (15.44s)
--- PASS: TestAccAWSS3Bucket_objectLock (19.55s)
--- PASS: TestAccAWSS3Bucket_Policy (35.15s)
--- PASS: TestAccAWSS3Bucket_region (14.15s)
--- PASS: TestAccAWSS3Bucket_Replication (130.64s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (87.14s)
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (26.74s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (108.61s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (40.18s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (41.80s)
--- PASS: TestAccAWSS3Bucket_RequestPayer (26.72s)
--- PASS: TestAccAWSS3Bucket_shouldFailNotFound (10.49s)
--- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (45.69s)
--- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (80.96s)
--- PASS: TestAccAWSS3Bucket_UpdateAcl (23.42s)
--- PASS: TestAccAWSS3Bucket_UpdateGrant (34.79s)
--- PASS: TestAccAWSS3Bucket_Versioning (31.30s)
--- PASS: TestAccAWSS3Bucket_Website_Simple (32.40s)
--- PASS: TestAccAWSS3Bucket_WebsiteRedirect (32.73s)
--- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (25.14s)
--- PASS: TestAccAWSS3MultiBucket_withTags (17.79s)

@bflad bflad merged commit a08a75d into hashicorp:master Mar 17, 2020
bflad added a commit that referenced this pull request Mar 17, 2020
@abhinavdahiya abhinavdahiya deleted the s3_no_bucket_tagging branch March 17, 2020 22:59
@ghost
Copy link

ghost commented Mar 19, 2020

This has been released in version 2.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 for triage. Thanks!

@ghost
Copy link

ghost commented Apr 16, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 16, 2020
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. 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.

2 participants