NOGROUP No such key or consumer group: No such key or consumer group in stream(stream 中不存在该键或消费者组)
Redis含义
您运行了 stream 消费命令(XREADGROUP、XACK、XCLAIM 等),但指定的键(stream)或消费者组不存在。未找到要操作的组/stream。
原因
组从未创建(跳过了 XGROUP CREATE);stream 键已被删除或从未写入;组名/键拼写错误;或组已被 XGROUP DESTROY 删除。在组创建之前消费者就已启动时很常见。
解决方法
首先确认 stream 和组存在:XINFO STREAM stream 和 XINFO GROUPS stream。如果组不存在,创建它:XGROUP CREATE stream group $ MKSTREAM(必要时也会创建 stream)。在应用启动时增加创建组的步骤(忽略 BUSYGROUP)。确认键名和组名拼写正确。
同一数据库的其他条目
- TRYAGAIN Multiple keys request during rehashing of slotMultiple keys request during rehashing of slot (cluster)(槽重新哈希期间的多键请求)
- ERR DISCARD without MULTIDISCARD without MULTI(未执行 MULTI 就调用 DISCARD)
- BUSYGROUP Consumer Group name already existsConsumer group already exists(消费者组已存在)
- NOTBUSY No scripts in execution right nowNo scripts in execution right now(当前没有正在执行的脚本)
- DENIED Redis is running in protected modeRedis is running in protected mode(Redis 正以保护模式运行)
- ERR Can't execute '<cmd>': only (P|S)SUBSCRIBE / (P|S)UNSUBSCRIBE / PING / QUIT / RESET are allowed in this contextCommand not allowed in subscribe context(在订阅上下文中不允许该命令)
- ERR SELECT is not allowed in cluster modeSELECT is not allowed in cluster mode(集群模式下不允许 SELECT)