# ERR Error claiming messages for consumer 'consumer1' on stream 'mystream': timeout

- **ID:** `redis/stream-group-claim-timeout`
- **Domain:** redis
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

The XCLAIM command timed out because the pending entries list (PEL) is too large or the consumer group is under heavy load, preventing the claim operation from completing within the idle timeout.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Redis 7.2.0 | active | — | — |
| Redis 7.4.0 | active | — | — |
| Redis Stack 7.2.0 | active | — | — |

## Workarounds

1. **Use XINFO GROUPS and XINFO CONSUMERS to inspect the PEL size, then trim pending entries with XTRIM or XDEL for acknowledged messages. For example: XINFO GROUPS mystream, then XDEL mystream <id1> <id2> for stale entries.** (80% success)
   ```
   Use XINFO GROUPS and XINFO CONSUMERS to inspect the PEL size, then trim pending entries with XTRIM or XDEL for acknowledged messages. For example: XINFO GROUPS mystream, then XDEL mystream <id1> <id2> for stale entries.
   ```
2. **Increase the consumer group's idle timeout via the 'idle' parameter in XCLAIM, but also implement a background job to periodically clean up the PEL using XAUTOCLAIM with a reasonable count.** (75% success)
   ```
   Increase the consumer group's idle timeout via the 'idle' parameter in XCLAIM, but also implement a background job to periodically clean up the PEL using XAUTOCLAIM with a reasonable count.
   ```
3. **Scale out consumers to reduce per-consumer PEL size, or use stream partitioning to distribute load across multiple streams.** (85% success)
   ```
   Scale out consumers to reduce per-consumer PEL size, or use stream partitioning to distribute load across multiple streams.
   ```

## Dead Ends

- **** — Increasing the idle timeout for XCLAIM may hide the symptom but doesn't address the root cause of PEL bloat or consumer lag. (60% fail)
- **** — Manually deleting large PEL entries without understanding the consumer group state can cause message loss or duplicate processing. (80% fail)
- **** — Restarting the consumer group or Redis instance may temporarily clear the timeout but the PEL will rebuild from pending messages, leading to recurrence. (70% fail)
