GCP
NOT_FOUND - Not Found: Resource Does Not Exist
Seeing NOT_FOUND tells you GCP couldn't locate the resource—wrong resource name, ID, or path; the resource was deleted; or you're querying the wrong project, region, or zone. This client-side error happens during resource lookup in the control plane. Resource identifiers are case-sensitive and must match exactly. Most common in Compute Engine when referencing VMs, disks, or networks, but also surfaces in Cloud SQL database instances, GKE clusters and node pools, and BigQuery datasets and tables. Some services support soft-delete with recovery windows, but timing varies.
#Common Causes
- →Incorrect Resource Identifier: The resource name, ID, or path contains typos or doesn't match what's stored in GCP. Resource identifiers must match exactly—case-sensitive and including special characters.
- →Resource Deleted: The resource was deleted from GCP. Deleted resources aren't accessible via standard queries. Some resources (like Cloud SQL databases) support soft-delete with recovery windows, but timing varies by service.
- →Wrong Project Context: The resource exists in a different project than the one you're querying. GCP queries resources within the specified project context, and cross-project access requires explicit configuration.
- →Wrong Region or Zone: Some resources are region or zone-specific. Querying a Compute Engine instance in the wrong zone, or a Cloud SQL instance in the wrong region, returns NOT_FOUND even if the resource exists elsewhere.
✓Solutions
- 1Step 1: Diagnose - List resources to find the correct identifier: gcloud compute instances list --project PROJECT_ID Or for Cloud SQL: gcloud sql instances list --project PROJECT_ID
- 2Step 2: Diagnose - Verify your project context: gcloud config get-value project
- 3Step 3: Diagnose - Check if the resource exists in a different project: gcloud projects list Then query each project with: gcloud compute instances list --project OTHER_PROJECT_ID
- 4Step 4: Diagnose - For Compute Engine, check if the resource exists in a different zone: gcloud compute instances list --project PROJECT_ID --zones=ZONE1,ZONE2
- 5Step 5: Fix - Use the correct resource identifier, project ID, or region/zone. For deleted resources, restore from snapshot if available: gcloud compute disks create restored-disk --source-snapshot SNAPSHOT_NAME --zone ZONE
</>Code Examples
Resource Lookup and Verification
1# This script helps diagnose NOT_FOUND errors by finding the correct resource
2
3PROJECT_ID="my-project"
4
5# Step 1: List all resources of the type you're looking for
6# Example: List Compute Engine instances
7echo "Listing Compute Engine instances..."
8gcloud compute instances list --project $PROJECT_ID
9
10# Example: List Cloud SQL instances
11# echo "Listing Cloud SQL instances..."
12# gcloud sql instances list --project $PROJECT_ID
13
14# Step 2: Check current project context
15echo "Current project:"
16gcloud config get-value project
17
18# Step 3: Describe a specific resource to verify it exists
19# Replace INSTANCE_NAME and ZONE with your values
20INSTANCE_NAME="my-instance"
21ZONE="us-central1-a"
22echo "Describing instance $INSTANCE_NAME in zone $ZONE..."
23gcloud compute instances describe $INSTANCE_NAME \
24 --zone $ZONE \
25 --project $PROJECT_ID
26
27# Step 4: If resource not found, check other zones
28echo "Checking other zones..."
29gcloud compute instances list --project $PROJECT_ID --zones=us-central1-a,us-central1-b,us-east1-a
30
31# Step 5: Check if resource exists in different projects
32echo "Listing all projects..."
33gcloud projects list
34# Then check each project:
35# gcloud compute instances list --project OTHER_PROJECT_ID↗Related Errors
Provider Information
This error code is specific to GCP services. For more information, refer to the official GCP documentation.