Can't delete a workspace that has children

I was trying to clean a certain billing project by deleting a bunch workspaces and I couldn’t delete some because of the following error message

Error deleting workspace
Cannot delete a resource with children. Delete the children first then try again.
Full error:
{
  "causes": [],
  "message": "Cannot delete a resource with children. Delete the children first then try again.",
  "source": "sam",
  "stackTrace": [],
  "statusCode": 400
}

What does a “resource with children” mean and is there a way to find what the “children” are?

Thanks!

Hi @camancuso ,

From the Terra team:

Thanks for writing in. That error usually indicates that there are resources still linked to the workspace that need to be cleaned up before the workspace can be deleted. These are usually old persistent disks or cloud environments.

What you can do is the following:

  1. Execute this API to list the children resources: https://sam.dsde-prod.broadinstitute.org/#/Resources/listResourceChildren
  • resourceTypeName = google-project
  • resourceId = <workspace Google project ID>
  1. Use this API to delete those children resource(s): https://sam.dsde-prod.broadinstitute.org/#/Resources/deleteResourceV2

Once you delete the children resources, you can try deleting the workspace again, either via the UI or API (https://rawls.dsde-prod.broadinstitute.org/#/workspaces/delete_workspace).

Thanks!
Ava

Thanks for sending this info! I got as a response

Clicking in the top right to authorize this API requires a Clint Secret. I’ll work on getting that from my cloud IT people.

Hi @camancuso ,

You should click the top right “Authorize” button, then click “Authorize” again to trigger the SSO for Terra. You shouldn’t need to enter a client_secret.

Authorize again

Thanks!
Ava