# 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.

Source: https://sqlly.app/errors/redis/nogroup
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Error prefix: `NOGROUP`
- Category: Streams and pub/sub

Error message:

```text
NOGROUP No such key 'orders' or consumer group 'workers' in XREADGROUP with GROUP option
```

## 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.

## How to fix it

1. Confirm what exists on the stream, on the database the consumer uses:

   ```sql
   SELECT 0
   TYPE orders
   XINFO GROUPS orders
   ```
2. Recreate the group, choosing the starting id deliberately: 0 replays history, $ starts at new entries:

   ```sql
   XGROUP CREATE orders workers 0
   ```
3. Make creation idempotent at startup so consumers self-heal: run XGROUP CREATE and ignore BUSYGROUP.

## Reproduce it safely

```sql
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
```

## How SQLly helps

SQLly shows the NOGROUP line with both names quoted, and XINFO GROUPS and TYPE run in the same editor, so the miss is pinned to the key or the group in one look.

## 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

- [`BUSYGROUP`](https://sqlly.app/errors/redis/busygroup): Consumer group already exists
- [`42P01`](https://sqlly.app/errors/postgresql/42P01): PostgreSQL: relation does not exist
- [`1146`](https://sqlly.app/errors/mysql/1146): MySQL: Table doesn't exist

The code and message text are from the [Redis documentation and source code](https://redis.io/docs/latest/).
