{
  "id": "kafka/invalid-partition-count",
  "signature": "org.apache.kafka.common.errors.InvalidPartitionCountException: Number of partitions must be greater than 0.",
  "signature_zh": "org.apache.kafka.common.errors.InvalidPartitionCountException：分区数必须大于 0。",
  "regex": "InvalidPartitionCountException",
  "domain": "kafka",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "An attempt was made to create or alter a topic with a partition count of zero or negative, which is not allowed.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试创建或更改分区数为零或负数的主题，这是不允许的。",
  "versions": [],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Setting partitions to 1 in a script that mistakenly passes 0 (e.g., from a default config) still fails; the fix is to validate input before the API call.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using a negative value from a bug in partition calculation code (e.g., integer overflow) will still be rejected; the code must be fixed.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure partition count is a positive integer. Example fix: `kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic my_topic --partitions 3` (never 0).",
      "success_rate": 0.95,
      "how": "Ensure partition count is a positive integer. Example fix: `kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic my_topic --partitions 3` (never 0).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure partition count is a positive integer. Example fix: `kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic my_topic --partitions 3` (never 0)."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#topicconfigs_num.partitions",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-11-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}