# UPSTREAM_TIMEOUT: The request timed out when connecting to the VPC connector. Check VPC connector health and subnet capacity.

- **ID:** `cloud/gcp-cloud-run-request-timeout-vpc-connector`
- **Domain:** cloud
- **Category:** network_error
- **Error Code:** `UPSTREAM_TIMEOUT`
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The Cloud Run service's VPC connector (Serverless VPC Access) has exhausted its subnet IP addresses or is underprovisioned, causing connection timeouts.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gcloud_cli | active | — | — |
| cloud_run | active | — | — |
| vpc_connector | active | — | — |

## Workarounds

1. **Increase the VPC connector's subnet size: `gcloud compute networks vpc-access connectors update my-connector --region us-central1 --min-instances 2 --max-instances 10` (if using scalable connector) or create a new connector with a /28 subnet (16 IPs) instead of /29 (8 IPs).** (85% success)
   ```
   Increase the VPC connector's subnet size: `gcloud compute networks vpc-access connectors update my-connector --region us-central1 --min-instances 2 --max-instances 10` (if using scalable connector) or create a new connector with a /28 subnet (16 IPs) instead of /29 (8 IPs).
   ```
2. **Monitor VPC connector usage: `gcloud compute networks vpc-access connectors describe my-connector --region us-central1` and check `maxInstances` and `connectedProjects`. If near limits, deploy a second connector in a different subnet and route traffic via DNS.** (75% success)
   ```
   Monitor VPC connector usage: `gcloud compute networks vpc-access connectors describe my-connector --region us-central1` and check `maxInstances` and `connectedProjects`. If near limits, deploy a second connector in a different subnet and route traffic via DNS.
   ```

## Dead Ends

- **** — The timeout is at the VPC connector level, not the application; increasing the Cloud Run timeout doesn't affect the connector's IP exhaustion. (85% fail)
- **** — More instances increase demand on the VPC connector, worsening IP exhaustion. (90% fail)
