You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
phorcys420 opened this issue
Dec 29, 2024
· 5 comments
· Fixed by #16012
Labels
need-helpAssign this label prompts an engineer to check the issue. Only humans may set this.s2Broken use cases or features (with a workaround). Only humans may set this.
When multiple docker-devcontainer workspaces are running, deleting one of them will trigger the following issue:
Terraform 1.9.8
coder_agent.main: Plan to delete
docker_volume.workspaces: Plan to delete
docker_image.devcontainer_builder_image: Plan to delete
coder_agent.main: Destroying... [id=d87332f6-93ab-420d-bf3d-5818bc0fc18c]
coder_agent.main: Destruction complete after 0s
docker_volume.workspaces: Destroying... [id=coder-aee29e12-d241-40e5-a075-f617b500a947]
docker_image.devcontainer_builder_image: Destroying... [id=sha256:0043aade3996c429a302de5f79050c63bf2a56a7286c5aef2cd65387bc870db5ghcr.io/coder/envbuilder:latest]
docker_image.devcontainer_builder_image: Destruction errored after 1s
docker_volume.workspaces: Destruction complete after 3s
Error: Unable to remove Docker image: Error response from daemon: conflict: unable to remove repository reference "ghcr.io/coder/envbuilder:latest" (must force) - container 7e439682639e is using its referenced image 0043aade3996
This is due to the fact that deleting a workspace will try to delete all of its resources, except the envbuilder image is shared between all the workspaces of that same template, which will make any workspace deletion fail.
But then you'll run into this issue when deleting the workspace:
Error: Instance cannot be destroyed
on main.tf line 156:
156: resource "docker_image" "devcontainer_builder_image" {
Resource docker_image.devcontainer_builder_image has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or reduce the scope of the plan using the -target option.
The text was updated successfully, but these errors were encountered:
phorcys420
added
the
need-help
Assign this label prompts an engineer to check the issue. Only humans may set this.
label
Dec 29, 2024
I have run into it multiple times. This is mostly a terraform thing rather than a Coder or builder issue.
matifali
added
s2
Broken use cases or features (with a workaround). Only humans may set this.
and removed
needs-triage
Issue that require triage
labels
Dec 30, 2024
I apologize if I am chiming in out of turn here. I'm one of the original users who reported this on discord in the above linked discussion.
I went ahead and tested this on my own instance.
Setting keep_locally did remedy the issue of not being able to delete workspaces. I can't speak authoritatively to any other side-effects, but I can say anecdotally that it doesn't appear that this change is causing any significant increase in storage usage.
need-helpAssign this label prompts an engineer to check the issue. Only humans may set this.s2Broken use cases or features (with a workaround). Only humans may set this.
(Discord discussion)
When multiple docker-devcontainer workspaces are running, deleting one of them will trigger the following issue:
This is due to the fact that deleting a workspace will try to delete all of its resources, except the
envbuilder
image is shared between all the workspaces of that same template, which will make any workspace deletion fail.Possible workaround
This could be fixed by adding the
lifecycle.prevent_destroy
attribute to thedocker_image
resource:But then you'll run into this issue when deleting the workspace:
The text was updated successfully, but these errors were encountered: