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- Category
- Streams and pub/sub
What it means
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.
Common causes
- 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
How to fix it
-
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.
Reproduce it safely
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
Questions
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.
Related errors
BUSYGROUPConsumer group already exists42P01PostgreSQL: relation does not exist1146MySQL: Table doesn't exist
The code and message text are from the Redis documentation and source code. Browse the full Redis error list or search every database error.
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.
Text and data on this page: CC BY 4.0, credit SQLly (sqlly.app). Code and SQL snippets: MIT. License details Quoted error message text belongs to its database vendor. View as Markdown