{
  "schema_version": 2,
  "id": "develop/reference/errors/common/nogroup",
  "title": "NOGROUP error",
  "url": "https://redis.io/docs/latest/develop/reference/errors/common/nogroup/",
  "summary": "A stream command named a consumer group or stream that doesn't exist.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-11-02T15:10:28+01:00",
  "page_type": "content",
  "content_hash": "89d460c0037bd7c548d8449e07926020e3010e74c68f63e58d568d97e7c2a531",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Redis returns this error when a stream command uses a consumer group that doesn't exist. The message names both the stream key and the group, because either one can be missing. Commands such as [`XREADGROUP`](https://redis.io/docs/latest/commands/xreadgroup), [`XPENDING`](https://redis.io/docs/latest/commands/xpending), [`XCLAIM`](https://redis.io/docs/latest/commands/xclaim), and [`XGROUP CREATECONSUMER`](https://redis.io/docs/latest/commands/xgroup-createconsumer) can return it.\n\n[code example]"
    },
    {
      "id": "example",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "how-to-fix-it",
      "title": "How to fix it",
      "role": "content",
      "text": "- **The group hasn't been created.** Create it with [`XGROUP CREATE`](https://redis.io/docs/latest/commands/xgroup-create) before any consumer reads from it. Add `MKSTREAM` to create the stream as well, if it doesn't exist yet:\n\n    [code example]\n\n    Without `MKSTREAM`, you can't create a group for a stream that doesn't exist:\n\n    [code example]\n\n- **The stream was deleted.** A consumer group is part of its stream. So when the stream key is deleted, or expires, its groups are deleted too. Create the group again.\n- **The key or group name is different.** Names are case-sensitive. To list a stream's groups, run [`XINFO GROUPS`](https://redis.io/docs/latest/commands/xinfo-groups).\n\nIf several consumers create the group when they start, see [`BUSYGROUP`](https://redis.io/docs/latest/develop/reference/errors/common/busygroup). For more about consumer groups, see [Consumer groups](https://redis.io/docs/latest/develop/data-types/streams#consumer-groups)."
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "plaintext",
      "code": "NOGROUP No such key 'mystream' or consumer group 'mygroup' in XREADGROUP with GROUP option",
      "section_id": "overview"
    },
    {
      "id": "example-ex0",
      "language": "plaintext",
      "code": "> XREADGROUP GROUP mygroup consumer1 STREAMS mystream >\n(error) NOGROUP No such key 'mystream' or consumer group 'mygroup' in XREADGROUP with GROUP option",
      "section_id": "example"
    },
    {
      "id": "how-to-fix-it-ex0",
      "language": "plaintext",
      "code": "> XGROUP CREATE mystream mygroup $ MKSTREAM\n    OK",
      "section_id": "how-to-fix-it"
    },
    {
      "id": "how-to-fix-it-ex1",
      "language": "plaintext",
      "code": "ERR The XGROUP subcommand requires the key to exist. Note that for CREATE you may want to use the MKSTREAM option to create an empty stream automatically.",
      "section_id": "how-to-fix-it"
    }
  ]
}
