-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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 putting S3 ACL: NoSuchBucket: The specified bucket does not exist #372
Comments
I see this issue when deleting an bucket, then creating one again with the same name: When I ran apply again it will modify the bucket: Terraform v0.9.11 |
facing the same issue in latest version Terraform v0.11.3 Error inspecting states in the "s3" backend: |
I'm having the same issue (I can see the bucket on S3).
|
I does work when I use the backend definition in the same folder where I create the bucket. |
I was facing the same problem when trying to deploy an S3 bucket with its bucket policy together. And the bucket name of the bucket policy is not a reference from the bucket resource but a variable shared by those two resources. Then terraform cannot figure out the dependency between those two resources. After explicit the dependency by using An alternative is to use the resource reference to get the bucket name so that terraform can have a clue to figure out the dependencies. |
Having same issue with 0.11.4. |
The error I see is 2018/03/20 11:33:14 [DEBUG] [aws-sdk-go] DEBUG: Validate Response s3/ListObjects failed, not retrying, error NoSuchBucket: The specified bucket does not exist |
I am seeing the same error with |
Hello, I have the same problem and I using Terraform v0.11.8. |
Same here Actually, it is quite easy to reproduce. My guess is that it has to do with AWS eventual consistency when you delete and create a bucket with the same name as before, even if it was not deleted recently. Consider this terraform
Now init, apply, destroy, clean? and repeat... I experience the issue with a 40% of occurrence.
Even inserting periods of sleep with seconds up to a minute between iterations, results are the same. I am going to try to look at the source code to see if I can figure out something about this issue. UPDATE: Follow up in #7803 |
I'm seeing something akin to this: This when creating a bucket with Simplified config: resource "aws_s3_bucket" "mybucket" {
bucket = "mybucket"
acl = "private"
tags = {
terraform = true
environment = var.environment
}
}
resource "aws_s3_bucket_notification" "mybucket_notification" {
bucket = aws_s3_bucket.mybucket.id
queue {
queue_arn = aws_sqs_queue.myqueue.arn
events = ["s3:ObjectCreated:*"]
filter_suffix = ".log.gz"
}
} The reference from The bucket name has not been used before; this is running in a CI pipeline with unique IDs in the bucket name. But I do think it's a matter of eventual consistency in S3 config, as mentioned in #7803 and #10068. It seems plausible that the fix for the OP's issue with ACLs and these notification settings be the same as the two linked issues, adding retry. Should I create a new issue for handling of notification related consistency issues? Or can both be handled in this issue? |
I'm seeing something akin to this again, but with a different error message this time: Same setup as previous example, so attempting to create notification config immediately after bucket creation. |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
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. |
This issue was originally opened by @abguy as hashicorp/terraform#10121. It was migrated here as part of the provider split. The original body of the issue is below.
My test deployment periodically failed with
Error putting S3 ACL: NoSuchBucket: The specified bucket does not exist
message. It looks like there is an issue with dependencies.I actually had to add an additional attempt to my deployment script, but it fails sometimes anyway.
Some parts of my deployment script with workaround:
Despite the workaround it fails sometimes. I see this failure several times per a week. Let me know if you need additional details and I will help to reproduce this issue.
The part of my configuration is main.tf
My Jenkins build console output with debug enabled console.log
The text was updated successfully, but these errors were encountered: