NOGROUP
RedisERRORNotableStreamsHIGH confidence

Consumer group does not exist on the stream

Production Risk

Medium — consumers cannot process messages until the group is created; messages accumulate in the stream.

What this means

Raised by stream commands such as XREADGROUP, XACK, XPENDING, and XCLAIM when the specified consumer group name has not been created on the target stream. The group must be explicitly created with XGROUP CREATE before use.

Why it happens
  1. 1XGROUP CREATE was never called for this stream/group combination.
  2. 2The stream key was deleted (DEL or FLUSHDB), destroying all associated consumer groups.
  3. 3A typo in the group name passed to XREADGROUP or XACK.
  4. 4The group was created on a different stream key than the one being read.
How to reproduce

A consumer tries to read from a group that has not been created yet.

trigger — this will error
trigger — this will error
# Stream exists but group was never created
XADD mystream * field1 value1
XREADGROUP GROUP mygroup consumer1 COUNT 1 STREAMS mystream >

expected output

(error) NOGROUP No such consumer group 'mygroup' for key name 'mystream'

Fix 1

Create the consumer group before reading

WHEN First-time setup or after a stream key was deleted

Create the consumer group before reading
# Create group starting from the beginning of the stream
XGROUP CREATE mystream mygroup 0

# Or create starting from new messages only
XGROUP CREATE mystream mygroup $

# Create the stream automatically if it does not exist
XGROUP CREATE mystream mygroup $ MKSTREAM

Why this works

XGROUP CREATE registers the group on the stream; subsequent XREADGROUP calls will succeed.

Fix 2

Handle NOGROUP in application startup

WHEN Your application manages its own group lifecycle

Handle NOGROUP in application startup
# Pseudo-code: idempotent group creation
try:
    redis.xgroup_create("mystream", "mygroup", id="
quot;, mkstream=True) except ResponseError as e: if "BUSYGROUP" not in str(e): raise # Only ignore 'group already exists'

Why this works

Creating the group at startup and ignoring BUSYGROUP makes group initialisation idempotent.

What not to do

Rely on the group existing without explicit creation

Redis does not auto-create consumer groups; NOGROUP will be raised every time until XGROUP CREATE is called.

Delete stream keys in production without recreating groups

Deleting the key destroys all consumer group state including pending entries.

Version notes
Redis 5.0

Streams and consumer groups introduced; NOGROUP error added.

Redis 7.0

XAUTOCLAIM and improved PEL handling added; NOGROUP behaviour unchanged.

Sources
Official documentation ↗

Redis Streams — consumer groups documentation

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Redis errors