{
  "id": "elasticsearch/persistent-task-assignment-failure",
  "signature": "PersistentTaskException: task [cluster:admin/persistent/assignment] failed to assign task [task_id_123] to node [node-1] after [5] attempts",
  "signature_zh": "持久化任务异常：任务 [cluster:admin/persistent/assignment] 在 [5] 次尝试后未能将任务 [task_id_123] 分配给节点 [node-1]",
  "regex": "PersistentTaskException: task \\[cluster:admin/persistent/assignment\\] failed to assign task \\[.*?\\] to node \\[.*?\\] after \\[\\d+\\] attempts",
  "domain": "elasticsearch",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A persistent task (e.g., ILM, Rollup, Watcher) cannot be assigned to any available node because of node attribute mismatches, resource constraints, or cluster topology changes during rolling restart.",
  "root_cause_type": "generic",
  "root_cause_zh": "持久化任务（例如ILM、Rollup、Watcher）由于节点属性不匹配、资源限制或滚动重启期间集群拓扑变化而无法分配给任何可用节点。",
  "versions": [
    {
      "version": "7.17.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.11.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.12.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Forceful restart causes more assignment failures as tasks lose their target nodes and can't reassign mid-restart.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Retries don't fix the underlying node attribute or resource issue; they only delay the eventual failure.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This removes the task but loses its progress, and the task may be recreated by the system (e.g., ILM) causing the same error again.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure all nodes have the required attributes set in `elasticsearch.yml` (e.g., `node.attr.rack: r1`) and restart nodes one by one, waiting for shard recovery after each restart.",
      "success_rate": 0.85,
      "how": "Ensure all nodes have the required attributes set in `elasticsearch.yml` (e.g., `node.attr.rack: r1`) and restart nodes one by one, waiting for shard recovery after each restart.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the `_tasks` API to reassign the task manually: `POST _tasks/task_id_123/_cancel` then `POST _tasks/task_id_123/_retry`.",
      "success_rate": 0.75,
      "how": "Use the `_tasks` API to reassign the task manually: `POST _tasks/task_id_123/_cancel` then `POST _tasks/task_id_123/_retry`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check node resource availability (CPU, memory) and scale up or add more nodes to the cluster to free up capacity.",
      "success_rate": 0.8,
      "how": "Check node resource availability (CPU, memory) and scale up or add more nodes to the cluster to free up capacity.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure all nodes have the required attributes set in `elasticsearch.yml` (e.g., `node.attr.rack: r1`) and restart nodes one by one, waiting for shard recovery after each restart.",
    "Use the `_tasks` API to reassign the task manually: `POST _tasks/task_id_123/_cancel` then `POST _tasks/task_id_123/_retry`.",
    "Check node resource availability (CPU, memory) and scale up or add more nodes to the cluster to free up capacity."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html",
  "official_doc_section": null,
  "error_code": "ES_PERSISTENT_TASK_ASSIGN_FAIL",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.82,
  "resolvable": "partial",
  "first_seen": "2024-06-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}