# Program Streams Errors and Reconnects

> Handle catalog changes, policy failures, and dropped Program Stream connections.

Canonical: https://nolimitnodes.com/docs/api-reference/program-streams/errors-reconnect

## Common status codes

| Code | Cause | Your action |
|---|---|---|
| `UNAUTHENTICATED` | Missing or invalid API key | Replace the key |
| `PERMISSION_DENIED` | Policy blocks the topic | Check account and policy scope |
| `NOT_FOUND` | Topic name is stale | Refresh `ListTopics` |
| `INVALID_ARGUMENT` | Topic or format is malformed | Fix the request |
| `RESOURCE_EXHAUSTED` | Account limit reached | Close unused subscriptions |
| `UNAVAILABLE` | Temporary transport failure | Reconnect with backoff |
| `INTERNAL` | Server processing failed | Retry once, then record details |

## Reconnect flow

1. Store the last processed slot.
2. Close the failed channel.
3. Wait with exponential backoff and jitter.
4. Refresh topics after catalog errors.
5. Open a fresh TLS channel.
6. Subscribe again.
7. Deduplicate overlap in storage.

Program Streams do not accept a replay slot.

For gap-sensitive systems, pair the stream with Yellowstone or RPC reads.

## Schema changes

Hash the `proto_schema` response.

When the hash changes:

1. Pause deployment.
2. Regenerate payload clients.
3. Decode stored fixtures.
4. Resume consumers after tests pass.

## Backpressure

Do not run slow database work inside the gRPC data callback.

Place events in a bounded queue. Stop or restart the stream when the queue reaches its limit.
