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

race condition on s3 bucket create #877

Closed
xchapter7x opened this issue Jun 15, 2017 · 3 comments
Closed

race condition on s3 bucket create #877

xchapter7x opened this issue Jun 15, 2017 · 3 comments
Labels
bug Addresses a defect in current functionality.

Comments

@xchapter7x
Copy link
Contributor

Terraform Version

terraform_0.9.8_linux_amd64.zip

Affected Resource(s)

Please list the resources as a list, for example:

  • resource_aws_s3_bucket

Terraform Configuration Files

resource "aws_s3_bucket" "pcf-bosh" {
    bucket = "${var.prefix}-pcf-bosh"
    acl = "private"
    force_destroy= true

    tags {
        Name = "${var.prefix}-pcf-bosh"
        Environment = "${var.prefix}"
    }
}

resource "aws_s3_bucket" "pcf-buildpacks" {
    bucket = "${var.prefix}-pcf-buildpacks"
    acl = "private"
    force_destroy= true

    tags {
        Name = "${var.prefix}-pcf-buildpacks"
        Environment = "${var.prefix}"
    }
}

Debug Output

https://gist.github.com/xchapter7x/33f777f55f3033bb0ed7c239c70fa6a6

Panic Output

Expected Behavior

Given a call to create a new bucket during terraform apply
When the buckets are successfully created
Then terraform should exit successfully without error

Actual Behavior

Given a call to create a new bucket during terraform apply
When the buckets are successfully created
Then terraform intermittently exits with NoSuchBucket: The specified bucket does not exist error

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply * 10 and you will see this error on a handful of attempts

Important Factoids

It feels like the follow on calls to the bucket, which happen after create bucket (https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_s3_bucket.go#L537)
should be wrapped with calls to WaitUntilBucketExists provided by the aws sdk.
This should avoid any potential races.

References

The issue I am experiencing was referenced as a side note in this issue (#291), but I do not see a issue created specifically for this.

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Jun 16, 2017
@xchapter7x
Copy link
Contributor Author

xchapter7x commented Jun 16, 2017

began this WIP PR... just investigating how you do your acceptance tests so i can add some before removing WIP marker...
Let me know your thoughts in the mean time

#891

nbaztec pushed a commit to nbaztec/terraform-provider-aws that referenced this issue Sep 26, 2017
nbaztec pushed a commit to nbaztec/terraform-provider-aws that referenced this issue Sep 26, 2017
nbaztec pushed a commit to nbaztec/terraform-provider-aws that referenced this issue Sep 26, 2017
nbaztec pushed a commit to nbaztec/terraform-provider-aws that referenced this issue Sep 26, 2017
nbaztec pushed a commit to nbaztec/terraform-provider-aws that referenced this issue Sep 26, 2017
@radeksimko
Copy link
Member

Addressed in #891

@ghost
Copy link

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

No branches or pull requests

2 participants