envbuilder
envbuilder copied to clipboard
Unable to Delete Workspace: Conflict Error Due to Image Reference in Use by Another Container
Issue:
When attempting to delete a workspace that uses the DevContainers Docker template, and another running container is using the same image, the deletion fails with the following error:
Error: Unable to remove Docker image: Error response from daemon: conflict: unable to remove repository reference "ghcr.io/coder/envbuilder:latest" (must force) - container xxxxxxx is using its referenced image xxxxxxx.
Steps to Reproduce:
- Create two workspaces, both using the DevContainers Docker template.
- Attempt to delete one workspace while the other is still running and using the same template.
- Observe the conflict error during the deletion process.
Workaround:
Attempting to delete the workspace after stopping the other running workspace succeeds.
Additonal Info:
- Similar issue on the Coder Discord: Link to message on Discord
Environment:
- Coder Version: v2.16.0+683a720
- OS: Linux (installed using the setup script)
@techwithanirudh Can you reproduce this behaviour without Terraform (that is, by running two instances of Envbuilder in parallel)? I'm expecting that this is not the case, and this behaviour is related to the kreuzwerker/docker Terraform provider.
@johnstcn Yes, I ran two Envbuilder instances in parallel. I tried stopping one, and there were no issues at all.