After the Developer Portal is enabled, it is not possible to delete a workspace as it is not empty. Even disabling the Developer Portal does not allow the workspace to be deleted. An error message is shown that files and rbac_roles exist.
Cannot delete a workspace after enabling the Developer Portal
Why can’t I delete a workspace after enabling the Developer Portal?
Enabling the Developer Portal creates default Pages, Partials, and Specs entities in the workspace, and these (along with any Developer Portal rbac_roles) must be deleted before the workspace can be removed. Re-enable the Portal so you can see and delete them, either one at a time or in bulk with the kong-portal-cli tool’s portal wipe <workspace_name> command.
Problem
Cause
When enabling the Developer Portal, the default set of Pages, Partials and Specs are created. These entities need to be deleted to empty the Workspace before the workspace can be deleted.
Solution
To delete the entities, there are two options. Both of these first require you to re-enable the Developer Portal so that the list of Pages, Partials, and Specs can be viewed.
Note: On Kong Gateway (Enterprise) 3.11.0.0 and later, the on-prem/Gateway-native Developer Portal is hard-deprecated and gated behind a separate, support-provided
portal_and_vitals_keylicense extra. Without that key, every Portal-dependent Admin API route (/files,/<workspace>/files,/specs, etc.) returns a flat 404 regardless of the workspace’sconfig.portalsetting. On a standard Enterprise license, enabling the Developer Portal for a workspace will not actually create any Pages/Partials/Specs entities in the first place, and this specific “workspace won’t delete because Dev Portal files exist” scenario should not occur today. If you do hit it, your license likely already carries theportal_and_vitals_keyextra, and the following removal steps remain valid.
Use either of the following options:
- Manually delete each entity until all of them have been removed.
-
Use the
kong-portal-clitool (the deployment tooling for the template files) in the separatekong-portal-templatesrepository. Follow the steps to install this utility and use a command similar to below to delete all the Developer Portal entities in one go:portal wipe <workspace_name>
If you have issues with deleting roles, see Cannot delete an empty workspace.