**TL;DR:** 500, 502, 503, and 504 are Pinecone-side and usually transient. Retry with exponential backoff and jitter. Fix Retry with exponential backoff and jitter, capped delay, max retries. Retry only 5xx and 429.

## The error

```text
504 Gateway Timeout
```

## The fix

1. `500 Unknown`: internal server error.

2. `502 Bad Gateway`: gateway got an invalid backend response.

3. `503 Unavailable`: service temporarily unavailable.

4. `504 Gateway Timeout`: backend too slow; can hit on heavy requests.

5. Retry only 5xx and 429. Never other 4xx.

6. Add jitter so a fleet of clients does not thunder-herd the recovery.

7. Log attempts with timestamps; you will need them if it persists. The Go SDK has this built in via `RetryPolicy` (covers 429 and transient 5xx plus gRPC UNAVAILABLE). Python and Node need the loop in your code; write it once in a helper, not per call site.

## When to use this

- You are seeing this exact error message; match the block above, not just part of it.
- The failing call matches the scenario in the title: Pinecone 5xx.
- You want the fastest verified fix before digging through logs.

## When not to use this

- Your error text differs from the block above; close cousins often have different causes.
- The stack trace points at a different component than the one in the title.
- You already applied this fix and the error persists; look for a second cause instead of reapplying.

## Compatibility

- Not pinned to a specific version; follows current Pinecone behavior.