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

Error tracking route_table_association on deletion #3615

Closed
Vlatombe opened this issue Oct 23, 2015 · 4 comments · Fixed by #3616
Closed

Error tracking route_table_association on deletion #3615

Vlatombe opened this issue Oct 23, 2015 · 4 comments · Fixed by #3616

Comments

@Vlatombe
Copy link
Contributor

This happens from time to time on terraform destroy, I believe it to be caused by a race condition between route_table and route_table_association.

This looks very much like #2295, so I will propose a similar fix.

Version: terraform 0.6.3 linux x64

Initial terraform configuration

resource "aws_vpc" "tiger" {
    cidr_block = "10.16.0.0/16"

    enable_dns_support = true
    enable_dns_hostnames = true
}

resource "aws_subnet" "tiger" {
    vpc_id = "${aws_vpc.tiger.id}"
    cidr_block = "10.16.0.0/16"
    map_public_ip_on_launch = true
}

resource "aws_internet_gateway" "tiger" {
    vpc_id = "${aws_vpc.tiger.id}"
}

resource "aws_route_table" "public" {
    vpc_id = "${aws_vpc.tiger.id}"

    route {
        cidr_block = "0.0.0.0/0"
        gateway_id = "${aws_internet_gateway.tiger.id}"
    }
}

resource "aws_route_table_association" "jce-public" {
    subnet_id = "${aws_subnet.tiger.id}"
    route_table_id = "${aws_route_table.public.id}"
}

output "vpc_id" {
    value = "${aws_vpc.tiger.id}"
}

output "vpc_subnet_id" {
    value = "${aws_subnet.tiger.id}"
}

logs

aws_vpc.tiger: Refreshing state... (ID: vpc-87c36de3)
aws_internet_gateway.tiger: Refreshing state... (ID: igw-7d828d18)
aws_subnet.tiger: Refreshing state... (ID: subnet-fe4e79d5)
aws_route_table.public: Refreshing state... (ID: rtb-e951c88d)
aws_route_table_association.jce-public: Refreshing state... (ID: rtbassoc-9c7540f8)
aws_route_table_association.jce-public: Destroying...
aws_route_table_association.jce-public: Destruction complete
aws_subnet.tiger: Destroying...
aws_route_table.public: Destroying...
aws_subnet.tiger: Destruction complete
Error applying plan:

1 error(s) occurred:

* aws_route_table.public: InvalidAssociationID.NotFound: The association ID 'rtbassoc-9c7540f8' does not exist
    status code: 400, request id: []

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
@eik3
Copy link

eik3 commented Oct 27, 2015

We're running into the same problem every now and then and I'm looking forward to having this fixed in TF!

@catsby
Copy link
Contributor

catsby commented Oct 27, 2015

Hey all – the supplied config file applied successfully for me (both creation and deletion). Is it sporadic? You mention race condition, do you have an idea of how often it happens?

@catsby catsby added the waiting-response An issue/pull request is waiting for a response from the community label Oct 27, 2015
@Vlatombe
Copy link
Contributor Author

Yes it's definitely sporadic. I just checked my CI builds and I would say this happens about 20% of the time.

@catsby catsby removed the waiting-response An issue/pull request is waiting for a response from the community label Oct 28, 2015
phinze added a commit that referenced this issue Oct 29, 2015
provider/aws: ignore association not exist on route table destroy [GH-3615]
@ghost
Copy link

ghost commented Apr 30, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants