{
  "schema_version": 2,
  "id": "commands/script-debug",
  "title": "SCRIPT DEBUG",
  "url": "https://redis.io/docs/latest/commands/script-debug/",
  "summary": "Sets the debug mode of server-side Lua scripts.",
  "since": "3.2.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:32+01:00",
  "page_type": "content",
  "content_hash": "3ce6d9622d598e22ef6d57b1edeca10dbec91681d5e2f47a1a4cf7b8f90bda87",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Set the debug mode for subsequent scripts executed with [`EVAL`](https://redis.io/docs/latest/commands/eval). Redis includes a\ncomplete Lua debugger (LDB) that can be used to make the task of\nwriting complex scripts much simpler. In debug mode Redis acts as a remote\ndebugging server and a client, such as [`redis-cli`](https://redis.io/docs/latest/develop/tools/cli), can execute scripts step by\nstep, set breakpoints, inspect variables, and more. For additional information\nabout LDB see the [Redis Lua debugger](https://redis.io/docs/latest/develop/programmability/lua-debugging) page.\n\n> [!WARNING]\n> Avoid debugging Lua scripts using your production Redis\n> server. Use a development server instead.\n\nYou can enable LDB in one of two modes: asynchronous or synchronous. In asynchronous mode, Redis creates a forked debugging session that does not block the server. Redis rolls back all data changes after the session ends, so you can restart debugging from the same initial state. In synchronous mode, Redis blocks the server while the debugging session is active and retains all data changes after the session ends.\n\n\n\nFor more information about [`EVAL`](https://redis.io/docs/latest/commands/eval) scripts please see [Introduction to Eval Scripts](https://redis.io/docs/latest/develop/programmability/eval-intro)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>YES | SYNC | NO</code></summary>\n\nSet the debugging mode:\n\n* `YES`: Enable non-blocking asynchronous debugging of Lua scripts (changes are discarded).\n* `SYNC`: Enable blocking synchronous debugging of Lua scripts (saves changes to data).\n* `NO`: Disable Lua script debug mode. Subsequent scripts run normally, without LDB.\n\n</details>"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`.\n\n**RESP3:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`."
    }
  ],
  "examples": []
}
