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

Bug: When you send a CTRL-C to gh tp, Terraform stops abruptly resulting in a lock persisting #22

Open
esacteksab opened this issue Feb 28, 2025 · 5 comments
Labels
upstream bug A bug that exists in a dependency. ⬆️🐛

Comments

@esacteksab
Copy link
Owner

When executing gh tp and while a plan is being created, sending a CTRL-C results in the Terraform lock file persisting. Terraform will take a CTRL-C more gracefully and do a proper shutdown. We should support/enable that behavior.

"Normal" Output of what Terraform looks like receiving a CTRL-C

terraform plan -out plan.out                     
^C
Interrupt received.
Please wait for Terraform to exit or data loss may occur.
Gracefully shutting down...

Stopping operation...

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: execution halted
│ 
│ 
╵
╷
│ Error: execution halted
│ 
│ 
╵
╷
│ Error: execution halted
│ 
│ 
╵
@esacteksab
Copy link
Owner Author

This is getting addressed here.

@esacteksab
Copy link
Owner Author

esacteksab commented Mar 1, 2025

Reference

Not sure if this is relevant but leaving it here just in case it could be.

@esacteksab
Copy link
Owner Author

Found https://github.com/hashicorp/terraform-exec/pull/334

@esacteksab
Copy link
Owner Author

Following the rabbit hole lead here https://github.com/opentofu/tofudl which just uses exec.Command()

@esacteksab esacteksab added upstream bug A bug that exists in a dependency. ⬆️🐛 and removed severity: 1 The Worst ☢ priority: critical priority: high type: bug An issue with the system 🐛. status: WIP topic: UX labels Mar 11, 2025
@esacteksab
Copy link
Owner Author

Removing WIP. This is an upstream bug. Need the PR above to land. I really don't want to use exec.Command().

@esacteksab esacteksab removed this from the v0.5.0 milestone Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream bug A bug that exists in a dependency. ⬆️🐛
Projects
None yet
Development

No branches or pull requests

1 participant