{
  "id": "redis/function-load-syntax-error",
  "signature": "ERR Error compiling script: <error_message>",
  "signature_zh": "错误：编译脚本错误：<error_message>",
  "regex": "ERR Error compiling script: .+",
  "domain": "redis",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A Redis function or Lua script loaded via FUNCTION LOAD or EVAL contains a syntax error or references undefined variables, causing compilation to fail.",
  "root_cause_type": "generic",
  "root_cause_zh": "通过FUNCTION LOAD或EVAL加载的Redis函数或Lua脚本包含语法错误或引用了未定义的变量，导致编译失败。",
  "versions": [
    {
      "version": "7.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "7.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "7.4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Simply retrying the same FUNCTION LOAD command without fixing the script will produce the same error; the script must be corrected.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling script cache or sandboxing (e.g., setting lua-time-limit to 0) does not fix syntax errors; it only affects runtime execution limits.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Debug the script locally using `redis-cli --eval /path/to/script.lua` to see detailed error messages. Fix syntax issues like missing 'end' or incorrect variable names, then reload with `FUNCTION LOAD`.",
      "success_rate": 0.95,
      "how": "Debug the script locally using `redis-cli --eval /path/to/script.lua` to see detailed error messages. Fix syntax issues like missing 'end' or incorrect variable names, then reload with `FUNCTION LOAD`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the Redis Lua debugger: `redis-cli --ldb --eval /path/to/script.lua` to step through the script and identify the exact line causing the error.",
      "success_rate": 0.85,
      "how": "Use the Redis Lua debugger: `redis-cli --ldb --eval /path/to/script.lua` to step through the script and identify the exact line causing the error.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在本地使用 `redis-cli --eval /path/to/script.lua` 调试脚本以查看详细错误信息。修复语法问题，如缺少'end'或变量名错误，然后使用 `FUNCTION LOAD` 重新加载。",
    "使用Redis Lua调试器：`redis-cli --ldb --eval /path/to/script.lua` 逐步执行脚本并识别导致错误的精确行。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://redis.io/commands/function-load/",
  "official_doc_section": null,
  "error_code": "ERR",
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2023-08-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}