{
  "id": "redis/err-unknown-subcommand",
  "signature": "ERR unknown subcommand or wrong number of arguments for 'SLOWLOG'",
  "signature_zh": "ERR 未知子命令或参数数量错误：'SLOWLOG'",
  "regex": "ERR unknown subcommand or wrong number of arguments for '[A-Z]+'",
  "domain": "redis",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Redis received an invalid subcommand or incorrect argument count for a valid command, often due to client library version mismatch or typo.",
  "root_cause_type": "generic",
  "root_cause_zh": "Redis 收到了无效的子命令或参数数量错误，通常是由于客户端库版本不匹配或拼写错误。",
  "versions": [
    {
      "version": "Redis 6.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 7.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "redis-py 4.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "redis-py 5.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Restarting does not change the client command that triggered the error.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The client library still sends the same malformed command.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This is a workaround that sacrifices monitoring capabilities.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Update the client library to a version compatible with your Redis server version. For example, in Python using redis-py, run: `pip install redis>=5.0.0`",
      "success_rate": 0.85,
      "how": "Update the client library to a version compatible with your Redis server version. For example, in Python using redis-py, run: `pip install redis>=5.0.0`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Verify the correct subcommand syntax by checking the Redis documentation. For SLOWLOG, use: `SLOWLOG GET 10` instead of `SLOWLOG GETALL`.",
      "success_rate": 0.9,
      "how": "Verify the correct subcommand syntax by checking the Redis documentation. For SLOWLOG, use: `SLOWLOG GET 10` instead of `SLOWLOG GETALL`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "In the client code, wrap the slow log command in a try-except and fall back to a known working subcommand. Example in Python: `try: r.execute_command('SLOWLOG', 'GET', 10) except redis.exceptions.ResponseError: r.execute_command('SLOWLOG', 'LEN')`",
      "success_rate": 0.75,
      "how": "In the client code, wrap the slow log command in a try-except and fall back to a known working subcommand. Example in Python: `try: r.execute_command('SLOWLOG', 'GET', 10) except redis.exceptions.ResponseError: r.execute_command('SLOWLOG', 'LEN')`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Update the client library to a version compatible with your Redis server version. For example, in Python using redis-py, run: `pip install redis>=5.0.0`",
    "Verify the correct subcommand syntax by checking the Redis documentation. For SLOWLOG, use: `SLOWLOG GET 10` instead of `SLOWLOG GETALL`.",
    "In the client code, wrap the slow log command in a try-except and fall back to a known working subcommand. Example in Python: `try: r.execute_command('SLOWLOG', 'GET', 10) except redis.exceptions.ResponseError: r.execute_command('SLOWLOG', 'LEN')`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://redis.io/docs/latest/commands/slowlog/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}