Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Destroying volume fails saying it's still attached to the machine #218

Closed
bilby91 opened this issue Jul 27, 2023 · 2 comments
Closed

Destroying volume fails saying it's still attached to the machine #218

bilby91 opened this issue Jul 27, 2023 · 2 comments

Comments

@bilby91
Copy link

bilby91 commented Jul 27, 2023

Hello,

We are using fly machines for our coder deployment.

We've been having issue with the destruction of the workspaces. Every time we try to delete the workspace, we run into this issue where the volume can't get deleted because it's still attached to the machine, even though the machine destruction has already successfully completed.

Initializing the backend...
Initializing provider plugins...
- Reusing previous version of fly-apps/fly from the dependency lock file
- Reusing previous version of coder/coder from the dependency lock file
- Using previously-installed fly-apps/fly v0.0.23
- Using previously-installed coder/coder v0.7.0
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Terraform 1.5.2
coder_app.code-server[0]: Plan to delete
coder_metadata.workspace[0]: Plan to delete
fly_machine.workspace[0]: Plan to delete
coder_agent.main: Plan to delete
fly_volume.home-volume: Plan to delete
fly_app.workspace: Plan to delete
coder_app.code-server[0]: Destroying... [id=228d3f47-0888-428b-97c4-2eceea497f3e]
coder_metadata.workspace[0]: Destroying... [id=dae4ceca-81dd-46fd-9eb5-7109e0e72f15]
coder_app.code-server[0]: Destruction complete after 0s
coder_metadata.workspace[0]: Destruction complete after 0s
fly_machine.workspace[0]: Destroying... [id=328743d0b43985]
fly_machine.workspace[0]: Destruction complete after 5s
fly_volume.home-volume: Destroying... [id=vol_jn924oqjj6qv03lq]
coder_agent.main: Destroying... [id=77642450-80c1-48c6-82a9-502ab6633032]
coder_agent.main: Destruction complete after 0s
fly_volume.home-volume: Destruction errored after 1s
Error: Delete volume failed
input:3: deleteVolume This volume is attached to a machine(328743d0b43985) and cannot be deleted.

Is there any workaround to avoid having to destroy resources multiple times?

@mootari
Copy link

mootari commented Jul 27, 2023

You can find a workaround here: #154 (comment)

@bilby91
Copy link
Author

bilby91 commented Jul 27, 2023

@mootari That did the trick!

Thanks!

@bilby91 bilby91 closed this as completed Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants