# rpc error: code = OutOfRange desc = index out of bounds: 10 > 5

- **ID:** `go/grpc-out-of-range-index`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A request attempted to access an element beyond the valid range, e.g., pagination offset too high.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.56.x | active | — | — |
| 1.57.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   if offset > totalItems { offset = totalItems }
   ```
2. **** (90% success)
   ```
   req := &pb.ListRequest{Offset: offset, Limit: limit}; if offset+limit > max { return error }
   ```
3. **** (85% success)
   ```
   resp, err := client.List(ctx, req); if resp.TotalCount > 0 { offset = min(offset, resp.TotalCount-1) }
   ```

## Dead Ends

- **Retrying with the same out-of-range index.** — Same error will occur. (100% fail)
- **Trying negative values.** — Still out of range. (80% fail)
- **Blaming server for incorrect range validation.** — Client should respect limits. (50% fail)
