NOGROUP: Consumer group does not exist
XREADGROUP or an XGROUP subcommand named a group or a stream that is not there: never created, or the key was deleted or renamed.
- Error prefix
NOGROUP
의미
NOGROUP is the streams lookup failure: the group name does not exist on that key, or the key itself is gone. On XREADGROUP it means the consumer cannot attach; on XGROUP subcommands such as DELCONSUMER, SETID and DESTROY it means the target group is missing. The reply names both the key and the group, so the miss is unambiguous.
The missing key is the subtle case. Unlike most Redis types, a stream survives as an empty-but-present key once all its entries are deleted, whether or not it has a group, so NOGROUP on a well-known stream name usually means a FLUSHDB, a rename, a different database index, or consumers that started before the group's creator ran.
일반적인 원인
- The group was never created on this stream: consumers started before the creator did.
- The stream key was deleted, renamed, or expired, and groups live and die with their key.
- The consumer and the creator connect to different logical databases or different instances.
Find the cause
TYPE orders XINFO GROUPS orders # Is the key there at all, and which groups exist on it? SELECT 0 # Check the database index too; a mismatch between producer and consumer is a classic
해결 방법
-
Confirm what exists on the stream, on the database the consumer uses:
SELECT 0 TYPE orders XINFO GROUPS orders
-
Recreate the group, choosing the starting id deliberately: 0 replays history, $ starts at new entries:
XGROUP CREATE orders workers 0
-
Make creation idempotent at startup so consumers self-heal: run XGROUP CREATE and ignore BUSYGROUP.
Other ways to handle it
If consumers may start against a fresh stream, create groups with MKSTREAM so the key exists even before the first XADD. For anything with strict ordering guarantees, run the group creation as a deploy step rather than inside consumer processes.
안전하게 재현하세요
redis-cli DEL orders redis-cli XADD orders * item widget redis-cli XREADGROUP GROUP workers consumer-1 COUNT 10 STREAMS orders > # (error) NOGROUP No such key 'orders' or consumer group 'workers' in XREADGROUP with GROUP option redis-cli XGROUP CREATE orders workers $ redis-cli XREADGROUP GROUP workers consumer-1 COUNT 10 STREAMS orders > # (nil) - attached, nothing new yet
질문
The stream exists, why still NOGROUP?
The group name is the miss. Groups are identified by the key and the name together, so a typo in either half produces this error.
Does deleting a stream delete its groups?
Yes. Groups and their pending-entry state belong to the key. DEL or FLUSHDB removes them; recreation starts with an empty pending list.
관련 오류
코드와 메시지 텍스트의 출처는 다음과 같습니다 Redis documentation and source code. 전체 목록은 Redis error list 또는 모든 데이터베이스 오류 검색.
Work on Redis in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Redis and the other databases you use.
이 페이지의 텍스트와 데이터: CC BY 4.0, 출처: SQLly (sqlly.app). 코드와 SQL 스니펫: MIT. 라이선스 세부 정보 인용된 오류 메시지 텍스트의 권리는 해당 데이터베이스 공급업체에 있습니다.