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
{{ message }}
Repository navigation
Deleting workspaces with no matching provisioner is convoluted #18080
customer-reportedDO NOT USE. Instead, add to the project and fill in "Customer".s2Broken use cases or features (with a workaround). Only humans may set this.
Let's say you had an external provisioner with a specific set of tags running at some point in the past, and you created a number of workspaces using that external provisioner (using coder_workspace_tags defined in the template).
Let's say that at some point, you decommission that external tagged provisioner and delete whatever compute resources it is running on.
In this situation, you will be unable to delete these workspaces (even with --orphan), as this creates a workspace build. The workspace tags will always be fetched from the template version, and the resulting provisioner job will fail to be acquired due to the tag mismatch.
Workarounds
Temporarily run another tagged provisioner and delete the workspaces
Update the template version to remove the tag requirement, update the workspaces, and delete the workspaces
Manually remove the rows from the database
Suggested Solution
The --orphan option should not need to create a provisioner job at all -- based on my understanding of the word "orphan", this means that the expection is that resources may be left running that will be the responsibility of the user to clean up.
If it is clear that no provisioner will be able to delete the workspace, and --orphan is specified, we could simply skip creating a job entirely and just delete the rows from the database.
I labeled this s2 because it breaks workflows where the operator decommissions some infrastructure with a tagged provisioner daemon. It becomes impossible to delete the affected workspaces once the provisioner daemons are decommissioned.
customer-reportedDO NOT USE. Instead, add to the project and fill in "Customer".s2Broken use cases or features (with a workaround). Only humans may set this.
Activity
matifali commentedon May 29, 2025
+1 to make
--orphandelete directly from DB without needing a provisioner.spikecurtis commentedon Jun 16, 2025
I labeled this
s2because it breaks workflows where the operator decommissions some infrastructure with a tagged provisioner daemon. It becomes impossible to delete the affected workspaces once the provisioner daemons are decommissioned.fix: complete job and mark workspace as deleted when no provisioners …
johnstcn commentedon Jun 23, 2025
Fixed by 2f55e29 and validated on dev.coder.com