-
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_route -> Error: error reading Route for Route Table (rtb-xxx) with destination (xx.x.x.x/xx) to become available: couldn't find resource (still) #19985
Comments
We're getting a similar error with
|
We are also getting a similar error with
but if you look in the console, the route table was successfully disasocciated. |
We are using the 3.47 version and getting this error during destroy
The resource is removed from AWs but not from the state file and Terraform exits with the error. Running destroy again refreshes the route table associations find them not there and continues destroying the rest of the VPC resources. This has happened multiple times. |
I updated the description above to include a zip file containing a TF file and shell script to reproduce the errors I am seeing. It just repeatedly creates and destroys the TF context until it has a problem. It sounds like people are having issues with more than just |
This is becoming a real issue as it causes the destroy to bail, leaving a lot of VPC resources around to be cleaned up. While doing things manually, it can be fixed by rerunning the terraform destroy, but when doing IAC automated testing the tests can't be rerun, as they are designed to create unique envs, each time. Therefore, someone has to manually go cleanup the env left behind. |
That is exactly our problem too, we had to remove the testing it was leaving behind a lot of stuff. |
As a hack we added a 2nd terraform destroy step to our IAC tests and if the issue happens then the 2nd destroy will cleanup what's left and if the issue doesn't happen the the extra destroy will add about 5s to the tests to figure out it needs to do nothing. This fixes the cleanup but the 1st destroy failing marks the test as a failure and there is no way to undo that it seems. |
@obourdon does your fix in #20265 also close this issue? Edit: ah so it looks like the fix only fixes destroys, not creates Cc @ewbankkit |
Also sometimes seeing something similar when creating aws_route_table_association.
The association exists in the console and matches when queried via the cli:
Strange thing is, other aws_route_table_association resources provision fine. |
These issues seem to be transient. I can run the same terraform, and may succeed on the first try, or require several retries to succeed, or may never seem to succeed, but complete successfully on the first try the next day. Maybe this points to a race condition? I haven't dug into the aws terraform provider codebase much, so just a guess- could there be a bug in querying aws during
|
We have the same problem @jpke I see these in the debug logging:
Strange thing is that we only encounter this when running the plan on TF Agents inside the VPC. When we switch the workspace to 'remote' the plan finishes quick. Using the remote runner: 1m 18s What did 'solve' it in our specific use case is enabling the EC2 interface endpoint in the VPC. Somehow it prevents from reaching the WaitForState condition (maybe reduced latency?). |
@ryancragun does your recent fix also resolve this issue? |
This functionality has been released in v3.62.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. 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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform version 0.14.11
AWS provider version 3.47.0
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Expected Behavior
Route is created successfully and
terraform apply
completes without issue.Actual Behavior
Terraform failed with:
Steps to Reproduce
19985-recreate.zip
recreate.sh
- repeatedly creates and destroys resources until it encounters a failure.Important Factoids
The
create
timeout value (which has been suggested as a mitigation to prior eventual consistency errors withaws_route
) does not seem to be honored (at least not for these post-creation retrievals). I'm not sure if waiting longer would be beneficial or not, though.References
A possible fix for this went in with #19426, but we are still seeing it with a version of AWS provider (3.47.0) that has the fix applied.
Similar issues:
The text was updated successfully, but these errors were encountered: