# ERR Consumer group offset rollback detected: last-delivered-id < oldest-id

- **ID:** `redis/stream-consumer-group-offset-rollback`
- **Domain:** redis
- **Category:** data_error
- **Error Code:** `ERM`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The stream was trimmed or deleted, causing the consumer group's last-delivered-id to be older than the oldest entry in the stream, leading to an inconsistent state.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 6.2 | active | — | — |
| 7.0 | active | — | — |
| 7.2 | active | — | — |

## Workarounds

1. **Run 'XGROUP SETID mystream mygroup 0-0' to reset to the beginning, then use XREADGROUP to re-process from the oldest entry.** (92% success)
   ```
   Run 'XGROUP SETID mystream mygroup 0-0' to reset to the beginning, then use XREADGROUP to re-process from the oldest entry.
   ```
2. **Set XTRIM with a minimum ID that is older than the group's last-delivered-id: 'XTRIM mystream MINID ~ <last-delivered-id>'.** (88% success)
   ```
   Set XTRIM with a minimum ID that is older than the group's last-delivered-id: 'XTRIM mystream MINID ~ <last-delivered-id>'.
   ```

## Dead Ends

- **** — May cause duplicate processing of already-consumed messages. (70% fail)
- **** — Loses all pending messages and consumer state; not suitable for production. (60% fail)
- **** — Consumer group will be stuck; no new messages delivered. (90% fail)
