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

aws_s3_bucket_object eventual consistency error after object creation #5841

Closed
bpiper opened this issue Sep 11, 2018 · 3 comments
Closed

aws_s3_bucket_object eventual consistency error after object creation #5841

bpiper opened this issue Sep 11, 2018 · 3 comments
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.
Milestone

Comments

@bpiper
Copy link

bpiper commented Sep 11, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

0.10.8

Affected Resource(s)

  • aws_s3_bucket_object

Expected Behavior

Resource creation 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"
  etag   = "${md5(file("${path.module}/foo"))}"
}

This seems like just another Terraform AWS eventual consistency issue. The resource is doing a HeadObject and a GetObjectTagging immediately after the PutObject. In this particular case that I encountered, it was the GetObjectTagging request that hit a 404. I have seen explicit retry logic used by other resources to accommodate eventual consistency, but there doesn't appear to be any in resource_aws_s3_bucket_object.go. Resources absolutely should be reading after write to ensure they are in a consistent state, but this needs to be done with some sort of retry/timeout logic.

@bflad bflad added bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service. labels Sep 12, 2018
@bflad bflad added this to the v1.56.0 milestone Jan 15, 2019
@bflad
Copy link
Contributor

bflad commented Jan 15, 2019

The fix for this is merged and will release with version 1.56.0 of the Terraform AWS provider, likely in the next day or two. 👍

@bflad bflad closed this as completed Jan 15, 2019
@bflad
Copy link
Contributor

bflad commented Jan 16, 2019

This has been released in version 1.56.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 1, 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 1, 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.
Projects
None yet
Development

No branches or pull requests

2 participants