-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
resource/aws_main_route_table_association: Crash during creation #16593
Comments
Relevant snippet of log:
Given the code:
The mainAssociation, err := findMainRouteTableAssociation(conn, vpcId)
if err != nil {
return fmt.Errorf("error finding EC2 VPC (%s) main route table association: %w", vpcId, err)
}
if mainAssociation == nil {
return fmt.Errorf("error finding EC2 VPC (%s) main route table association: not found", vpcId)
}
resp, err := conn.ReplaceRouteTableAssociation(&ec2.ReplaceRouteTableAssociationInput{ This won't prevent whatever caused the issue to begin with, but it will at least return a proper error instead of the crash. |
@paschalidi do you have any additional information about what may have caused this crash? e.g. what you were trying to do, an example configuration, etc. |
hey well, I was trying to set up a vpc with some ec2 instances. I dont know if that helps but I run many time the After a while things were out of sync and terraform was crashing. I hope this helps a little @bdoepf. Cant say more than that unfortunately, but I hope I can help |
…when VPC main route table association is not found Reference: #16593 This is quick fix to replace the crash behavior with an actual error message. Additional information is needed to determine why this issue occurs (e.g. EC2 eventual consistency, problematic configurations, etc.) but this at least gives operators a better chance to continue other parts of the apply successfully and potentially just rerun the errant resource. Output from acceptance testing: ``` --- PASS: TestAccAWSMainRouteTableAssociation_basic (62.60s) ```
Fix submitted to return an error instead of crash in this situation: #16680 |
Thanks for looking into this @bflad. |
…when VPC main route table association is not found (#16680) Reference: #16593 This is quick fix to replace the crash behavior with an actual error message. Additional information is needed to determine why this issue occurs (e.g. EC2 eventual consistency, problematic configurations, etc.) but this at least gives operators a better chance to continue other parts of the apply successfully and potentially just rerun the errant resource. Output from acceptance testing: ``` --- PASS: TestAccAWSMainRouteTableAssociation_basic (62.60s) ```
The fix to prevent the crash (and instead return an error) has been merged and will release with version 3.22.0 of the Terraform AWS Provider, likely tomorrow. Please note that this fix is not intended to prevent any potentially underlying problem that might be causing the association to be non-existent when the code is executed. If the new error is being thrown in a reproducible way after this adjustment, it is best to submit a new bug report following the issue template so we have further details for troubleshooting. 👍 |
This has been released in version 3.22.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 for triage. Thanks! |
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! |
This issue was originally opened by @paschalidi as hashicorp/terraform#27142. It was migrated here as a result of the provider split. The original body of the issue is below.
Version
https://gist.github.com/paschalidi/acdf7d52afbe0e415a5a26dca96e2478
The text was updated successfully, but these errors were encountered: