-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Error creating S3 bucket with tags - error getting S3 bucket tags: NoSuchBucket: The specified bucket does not exist #10068
Comments
I'm also having this issue in WorkaroundA little annoying but easy to fix
|
Running into this issue with @mscansian would work however we can't do this on Terraform Enterprise |
Not sure the Terraform version here is relevant (0.10.8 for me), but we spin up a test stack several times daily, and according to our logs (which go back years), the first occurrence of this error (which by the way has no correspondence with any changes to our resource definitions) was on September 23rd, on version 2.29.0 of the provider. We've also noticed it happening much more frequently just in the past week. That's not to say that changes in the provider precipitated this issue though, as it could easily be due to a change on Amazon's end (i.e. eventual consistency becoming rather more 'eventual'). Nevertheless, I do wonder if there should be some retry logic around getting bucket tags. |
We have started seeing the same thing roughly about the same time using boto3 call such as this:
It would occasionally fail to put the tagging on because encryption operation makes the bucket "not exist". Perhaps waiters are needed around every single operation on the bucket now. |
We hit this too. CloudTrail logs of one such case here, which show:
our failed |
@wking any luck with the AWS ticket? |
Oops, yeah. Bruce B on Fri Oct 18 2019 07:06:57 GMT-0700:
So seems like there's no workaround besides queueing a retry, and dying if that fails for longer than we're willing to wait for AWS to resolve its eventual consistency. |
…ket errors due to eventual consistency Reference: #10068 Previously, our acceptance testing would report eventual consistency issues such as: ``` --- FAIL: TestAccAWSS3Bucket_tagsWithSystemTags (11.28s) testing.go:615: Step 0 error: errors during apply: Error: error getting S3 bucket tags: NoSuchBucket: The specified bucket does not exist --- FAIL: TestAccAWSCodeBuildProject_Artifacts_ArtifactIdentifier (7.39s) testing.go:615: Step 0 error: errors during apply: Error: error getting S3 bucket tags: NoSuchBucket: The specified bucket does not exist ``` The `aws_s3_bucket` resource tends to call our `retryOnAwsCode()` helper function to deal with this type of eventual consistency issue so we also add that handling to this API call as well. Output from acceptance testing (after retrying any failing tests due to other read-after-write eventual consistency issues): ``` --- PASS: TestAccAWSS3Bucket_acceleration (57.29s) --- PASS: TestAccAWSS3Bucket_basic (32.63s) --- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (30.76s) --- PASS: TestAccAWSS3Bucket_Cors_Delete (29.45s) --- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (32.09s) --- PASS: TestAccAWSS3Bucket_Cors_Update (55.25s) --- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (52.43s) --- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (30.94s) --- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (61.25s) --- PASS: TestAccAWSS3Bucket_forceDestroy (26.03s) --- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (26.81s) --- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (33.29s) --- PASS: TestAccAWSS3Bucket_generatedName (31.31s) --- PASS: TestAccAWSS3Bucket_LifecycleBasic (78.75s) --- PASS: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (52.02s) --- PASS: TestAccAWSS3Bucket_Logging (49.71s) --- PASS: TestAccAWSS3Bucket_namePrefix (30.67s) --- PASS: TestAccAWSS3Bucket_objectLock (52.31s) --- PASS: TestAccAWSS3Bucket_Policy (70.45s) --- PASS: TestAccAWSS3Bucket_region (29.50s) --- PASS: TestAccAWSS3Bucket_Replication (223.64s) --- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (141.38s) --- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (35.00s) --- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (231.22s) --- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (67.87s) --- PASS: TestAccAWSS3Bucket_RequestPayer (53.47s) --- PASS: TestAccAWSS3Bucket_shouldFailNotFound (13.40s) --- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (94.76s) --- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (144.59s) --- PASS: TestAccAWSS3Bucket_UpdateAcl (53.37s) --- PASS: TestAccAWSS3Bucket_WebsiteRedirect (77.20s) --- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (57.40s) ```
We have also seen this pop up randomly in our daily acceptance testing for the project, e.g.
Submitted a fix here: #10863 |
This has been released in version 2.36.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! |
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! |
Community Note
Terraform Version
Terraform v0.11.7
Affected Resource(s)
Terraform Configuration Files
Here is a simplified version of the configuration file:
Expected Behavior
You have an S3 bucket after
terraform apply
Actual Behavior
In our builds we have randomly the error message "error getting S3 bucket tags: NoSuchBucket: The specified bucket does not exist", and the build breaks. It seems to be some race condition.
If we look at CloudTrail we can see that we have the CreateBucket event, but not the PutBucketTagging event when the build fails.
Steps to Reproduce
Here is a script to try to reproduce it.
The text was updated successfully, but these errors were encountered: