Skip to content

Deleting workspaces with no matching provisioner is convoluted #18080

Closed

Description

@johnstcn

Problem

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

  1. Temporarily run another tagged provisioner and delete the workspaces
  2. Update the template version to remove the tag requirement, update the workspaces, and delete the workspaces
  3. 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.

Activity

  1. added theissue type on May 28, 2025
  2. matifali commented on May 29, 2025

    @matifali
    Contributor

    +1 to make --orphan delete directly from DB without needing a provisioner.

  3. added
    s2
    on Jun 16, 2025
  4. spikecurtis commented on Jun 16, 2025

    @spikecurtis
    Collaborator

    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.

  5. added
    customer-reported
    on Jun 16, 2025
  6. assigned and unassigned on Jun 18, 2025
  7. johnstcn commented on Jun 23, 2025

    @johnstcn
    MemberAuthor

    Fixed by 2f55e29 and validated on dev.coder.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

customer-reporteds2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions