{
  "id": "cicd/kubectl-apply-pending",
  "signature": "Error from server (Conflict): Operation cannot be fulfilled on pods \"my-app-5d4f8b7c6-abcde\": the object has been modified; please apply your changes to the latest version and try again",
  "signature_zh": "来自服务器的错误（冲突）：无法完成对 pod \"my-app-5d4f8b7c6-abcde\" 的操作：对象已被修改；请将更改应用于最新版本并重试",
  "regex": "Error from server \\(Conflict\\): Operation cannot be fulfilled on.*the object has been modified",
  "domain": "cicd",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A Kubernetes resource update conflict occurs when two or more controllers or CI jobs try to modify the same resource concurrently, causing the second update to fail due to stale resourceVersion.",
  "root_cause_type": "generic",
  "root_cause_zh": "当两个或多个控制器或 CI 作业尝试同时修改同一 Kubernetes 资源时，会发生资源更新冲突，导致第二个更新因 resourceVersion 过期而失败。",
  "versions": [
    {
      "version": "Kubernetes 1.28",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes 1.29",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "kubectl 1.29.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Deleting and recreating the resource manually; this causes downtime and may trigger cascading failures in dependent services.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using `kubectl replace --force` which deletes and recreates the resource; this bypasses conflict detection but can delete other dependent objects.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Ignoring the error and retrying the same CI job without changes; the conflict persists because the resourceVersion hasn't been updated.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Re-run the CI job after a short delay (e.g., 10 seconds) to allow the conflicting operation to complete and the resourceVersion to update.",
      "success_rate": 0.8,
      "how": "Re-run the CI job after a short delay (e.g., 10 seconds) to allow the conflicting operation to complete and the resourceVersion to update.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `kubectl apply --server-side=true` which uses server-side apply to merge changes without conflict errors.",
      "success_rate": 0.9,
      "how": "Use `kubectl apply --server-side=true` which uses server-side apply to merge changes without conflict errors.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a retry loop in the CI script: `for i in 1 2 3; do kubectl apply -f deployment.yaml && break || sleep 5; done`",
      "success_rate": 0.85,
      "how": "Add a retry loop in the CI script: `for i in 1 2 3; do kubectl apply -f deployment.yaml && break || sleep 5; done`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在短暂延迟（例如 10 秒）后重新运行 CI 作业，以允许冲突操作完成并更新 resourceVersion。",
    "使用 `kubectl apply --server-side=true`，它使用服务器端应用来合并更改而不会出现冲突错误。",
    "在 CI 脚本中添加重试循环：`for i in 1 2 3; do kubectl apply -f deployment.yaml && break || sleep 5; done`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kubernetes.io/docs/reference/using-api/api-concepts/#conflicts",
  "official_doc_section": null,
  "error_code": "K8S_CONFLICT",
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-03-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}