# 消费者组 'mygroup' 在流 'mystream' 上的声明超时：没有待声明的消息

- **ID:** `redis/stream-consumer-group-claim-timeout`
- **领域:** redis
- **类别:** runtime_error
- **错误码:** `ERR`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

XCLAIM 命令超时，因为消费者组中没有匹配指定空闲时间或数量的待处理消息。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| redis 7.0 | active | — | — |
| redis 7.2 | active | — | — |
| redis 6.2 | active | — | — |

## 解决方案

1. ```
   Use XPENDING to check the pending message list before claiming, then adjust idle time or count accordingly:
XPENDING mystream mygroup
   ```
2. ```
   Ensure consumers are actively processing messages to generate pending entries; if idle, use XREADGROUP with a valid consumer name.
   ```

## 无效尝试

- **** — Timeout increase does not create pending messages; the root cause is lack of messages to claim. (60% 失败率)
- **** — Restarting resets group state but does not address the missing pending messages; messages may still be absent. (70% 失败率)
- **** — Deleting the stream removes all messages, making the claim even more impossible. (90% 失败率)
