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
Workspaces can be created with invalid values, then cannot be deleted #831
If you create a new workspace with invalid values, there are a couple unexpected things:
you can't reuse that name (i.e. coder doesn't automatically delete the invalid workspace)
you can't delete the workspace
you can't edit the workspace to fix the invalid value
Steps to Reproduce
`../coder workspaces create test-workspace``
Select a project
Enter invalid disk size (i.e. 3)
See Error
Logs
Can't reuse workspace name
➜ aws-linux ../coder workspaces create joes-workspace
Select a project:
> Creating with the aws-linux project...
Error: A workspace already exists named "joes-workspace"!
Can't delete workspace
➜ aws-linux ../coder workspaces delete joes-workspace
✔ Queued [51ms]
✔ Setting up [1ms]
⧗ Destroying workspace
Terraform 1.1.7
Error: Invalid value for variable
Disk size must be between 8 and 256.
This was checked by the validation rule at main.tf:40,3-13.
✘ Destroying workspace [6114ms]
Error: recv workspace provision: read file "/var/folders/c7/ns6lqzvx3z10mq647y5g9lqc0000gn/T/provisionerd3690011094/terraform.tfstate": open /var/folders/c7/ns6lqzvx3z10mq647y5g9lqc0000gn/T/provisionerd3690011094/terraform.tfstate: no such file or directory
Can't edit workspace
➜ aws-linux ../coder workspaces edit joes-workspace
Usage:
coder workspaces [command]
Aliases:
workspaces, ws
Commands:
create Create a workspace from a project
delete
list
show
ssh
start
stop
update
Flags:
-h, --help helpfor workspaces
Global Flags:
--global-config coder Path to the global coder config directory (default "/Users/jp/Library/Application Support/coderv2")
Use "coder workspaces [command] --help"for more information about a command.
➜ aws-linux ../coder workspaces update joes-workspace
Workspace isn't outdated!
How does coder state pull work? I'm running coder state pull <NAME_OF_WORKSPACE> and the command succeeds without any terminal output or any files created in my working directory.
I'm also not sure there are any terraform resources I need to destroy (because none were created originally for this invalid workspace) - is there a different path I should take to just remove coderd's knowledge of the invalid workspace?
Ahh, you're in a locked state then, unfortunately. This is something I'll have a patch out for in a few days though, so for now I suppose just leave that workspace hanging 😥.
Reacted by Kevin Conley (Inactive) and Joe Previte
This issue is mitigated by #1594 (which allows you to delete workspaces in this broken state), but I will be making further effort to catch validation errors earlier on.
Reacted by Joe Previte and Kevin Conley (Inactive)
changed the title [-]Cannot delete workspace if created with invalid values[/-][+]Workspaces can be created with invalid values, then cannot be deleted[/+]on May 24, 2022
Activity
misskniss commentedon May 12, 2022
Hey team! Please add your planning poker estimate with ZenHub @kylecarbs @coadler
kconley-sq commentedon May 16, 2022
I've just run into this myself. :( Is there any workaround to delete the invalid workspace (even if it involves hitting some API endpoint manually)?
kylecarbs commentedon May 16, 2022
You can grab the state with
coder state pull <name>andterraform destroyyourself with parameters. We'll be fixing this soon!kconley-sq commentedon May 16, 2022
How does
coder state pullwork? I'm runningcoder state pull <NAME_OF_WORKSPACE>and the command succeeds without any terminal output or any files created in my working directory.I'm also not sure there are any terraform resources I need to destroy (because none were created originally for this invalid workspace) - is there a different path I should take to just remove coderd's knowledge of the invalid workspace?
kylecarbs commentedon May 16, 2022
Ahh, you're in a locked state then, unfortunately. This is something I'll have a patch out for in a few days though, so for now I suppose just leave that workspace hanging 😥.
[-]coder workspaces with invalid values[/-][+]Cannot delete workspace if created with invalid values[/+]deansheather commentedon May 24, 2022
This issue is mitigated by #1594 (which allows you to delete workspaces in this broken state), but I will be making further effort to catch validation errors earlier on.
[-]Cannot delete workspace if created with invalid values[/-][+]Workspaces can be created with invalid values, then cannot be deleted[/+]