-
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
aws_s3_bucket_object eventual consistency error after object creation #12652
Comments
It looks like the usual "eventual consistency" in AWS API. |
Is there a workaround for this? I'm seeing the issue with v3.14.0 In my case, I'm creating 4 folder objects and fairly often 1 or 2 of them will fail with "NoSuchKey: The specified key does not exist". The ones that do succeed report "Creation complete after 0s" I have not tried experimenting with max_retries yet, but given that the default is 25, I have my doubts that increasing that would help. |
Are there any updates for this? I am running into the same issue with the latest version of the AWS provider, and using the newer (recommended) |
For anyone else still having this issue, this is the temporary workaround I had to go with: # Temporary workaround until this GitHub issue on aws_s3_object is resolved: https://github.com/hashicorp/terraform-provider-aws/issues/12652
resource "null_resource" "put_s3_object" {
# Will only trigger this resource to re-run if changes are made to the Dockerfile
triggers = {
src_hash = data.archive_file.streamlit_assets.output_sha
}
# Put .zip file for Streamlit App Assets in S3 Bucket
provisioner "local-exec" {
command = "aws s3 cp ${var.app_name}-assets.zip s3://${aws_s3_bucket.streamlit_s3_bucket.id}/${var.app_name}-assets.zip"
}
# Only attempt to put the file when the S3 Bucket (and related resources) are created
depends_on = [
aws_s3_bucket.streamlit_s3_bucket,
aws_s3_bucket_notification.streamlit_s3_bucket,
aws_s3_bucket_policy.streamlit_s3_bucket,
aws_s3_bucket_versioning.streamlit_s3_bucket
]
} |
Also effecting us....
|
Community Note
Terraform Version
0.12.20
Aws Provider Version
2.54
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Resource creation is successful.
Actual Behavior
aws_s3_bucket_object.foo: Failed to get object tags (bucket: some-bucket, key: /foo): NoSuchKey: The specified key does not
As is generally the case with eventual consistency issues, this only happens sometimes.
Steps to Reproduce
Just define a standard S3 bucket object like so and run apply:
resource "aws_s3_bucket_object" "foo" {
bucket = "some-bucket"
key = "/foo"
source = "${path.module}/foo"
}
Eventually, you get:
References
The text was updated successfully, but these errors were encountered: