Troubleshooting project deletion

The following sections describe common errors that can block the deletion of a project, and what you can do to resolve them. If you are having issues, try using the Google Cloud CLI to shut down a project, and note any error message you receive.

Liens

If there is a lien on a project, that project cannot be deleted until the lien is removed. If you have the resourcemanager.projects.get permission on the project, you can list the liens applied to a project with the liens list gcloud CLI command.

For more information about liens, see protecting projects with liens.

Cloud Endpoints

Cloud Endpoints are special resources that are considered child resources under a project. This can block the deletion of a project where Endpoints exist.

The below example shows an attempt to delete a project using the Google Cloud CLI failing due to the existence of Endpoints under the project:

@cloudshell:~ ($project)$ gcloud projects delete $project
Your project will be deleted.

Do you want to continue (Y/n)?  Y

ERROR: (gcloud.projects.delete) FAILED_PRECONDITION: active child resource
- '@type':type.googleapis.com/google.rpc.PreconditionFailure
 violations:
 - description: active child resource
   subject: services/$service
- '@type':type.googleapis.com/google.rpc.ResourceInfo
 resourceName: projects/$project
 resourceType: PROJECT

To resolve this issue, delete the Endpoints before you attempt to delete the project.

For more information about Endpoints, see the Cloud Endpoints documentation.

Shared Virtual Private Cloud

If a project has shared Virtual Private Cloud (VPC) enabled or has service projects attached, a lien will block the deletion of the project.

For more details and instructions on how to detach service projects and disable shared VPC, see Deprovisioning shared VPC.