This document describes how to troubleshoot consistency, replication delays, and
quota metric behavior when querying global resources through Compute Engine
regional view API endpoints. For more information about
regionalized read-only endpoints, see
[Regional views of global resources](https://docs.cloud.google.com/compute/docs/architecture/regional-views-global-resources.md.txt).

## Replication delays or missing resources

When you query regional metadata endpoints, you might observe that newly created
global resources or recently updated metadata fields don't immediately appear
in regional responses.

Regional view APIs serve read requests by querying a regional read-only replica
of the central global database. Updates made to primary global resources using
standard global endpoints are replicated asynchronously to these regional
replicas.

This asynchronous replication means regional views are
*eventually consistent*. P99 replication latency from the central global database
to regional replicas is typically under 60 seconds.

**Resolution**: To resolve this issue, try one of the following:

- **Wait for replication**: Most replication updates complete within 60 seconds. If an automated script or client workload queries a newly created resource, ensure your client implements retry logic with exponential backoff.
- **Understand transparent fallback** : If an explicit `GET` request for a specific resource ID targeting a regional replica results in a cache miss, Compute Engine automatically attempts a fallback read to the central global database within the same transaction.
- **Query global endpoints for strong consistency** : If your deployment pipeline strictly requires immediate read-after-write consistency without replication latency, query canonical global endpoints directly instead of regional views. For example, query [`projects.get`](https://docs.cloud.google.com/compute/docs/reference/rest/v1/projects/get.md.txt), [`images.get`](https://docs.cloud.google.com/compute/docs/reference/rest/v1/images/get.md.txt), or [`images.list`](https://docs.cloud.google.com/compute/docs/reference/rest/v1/images/list.md.txt).

## `404 Not Found` responses

You might receive a `404 Not Found` HTTP status code when attempting to retrieve
a specific image or project view.

A `404 Not Found` error might occur for the following reasons:

- The target resource does not exist in the central global database.
- The target resource was created within the last few seconds, replication to the regional replica has not completed, and the transparent fallback request to the central global database timed out or failed.
- You specified an invalid region parameter or project ID in the request URL.

**Resolution**: To resolve this issue, try the following:

1. Verify that the requested resource exists globally by running a standard global `describe` or `list` request---for example, `gcloud compute images describe IMAGE_NAME` or `gcloud compute project-info describe --project=PROJECT_ID`.
2. Inspect the request URL path to ensure the target `REGION` string is valid and active.
3. If the resource was newly created, retry the request after 60 seconds.

## Missing `quota` array in `projectViews` responses

When querying a `compute.Project` resource using regional `projectViews.get`
endpoints, the `quota` array is excluded from the response.

To maintain regional fault isolation and high availability, the `projectViews`
endpoint reads strictly from its regional replica. Because it doesn't perform
cross-region fanouts to collect quota usage across zones, the `quota` array is
excluded.

**Resolution**: To resolve this issue, do the following:

- Ensure that your applications don't expect the `quota` array in responses returned by regional `projectViews` endpoints.
- To retrieve accurate quota configuration and real-time usage metrics across all regions and zones, query the global [`projects.get`](https://docs.cloud.google.com/compute/docs/reference/rest/v1/projects/get.md.txt) endpoint or monitor Compute Engine API quota metrics in Cloud Monitoring.

## What's next

- Review [Use regional views for resilient control-plane reads](https://docs.cloud.google.com/compute/docs/architecture/regional-views-global-resources.md.txt).
- Learn how to [Access global resources regionally for high availability](https://docs.cloud.google.com/compute/docs/architecture/access-global-resources-regionally.md.txt).