{
  "id": "kubernetes/statefulset-update-rollback-failed",
  "signature": "Error from server (Conflict): Operation cannot be fulfilled on statefulsets.apps 'my-statefulset': the object has been modified; please apply your changes to the latest version and try again",
  "signature_zh": "服务器错误（冲突）：无法完成对statefulsets.apps 'my-statefulset' 的操作：对象已被修改；请将您的更改应用到最新版本并重试",
  "regex": "Operation cannot be fulfilled on statefulsets.apps '.*': the object has been modified",
  "domain": "kubernetes",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A concurrent update to the StatefulSet (e.g., by a controller or another user) caused a resource version conflict when trying to apply a change, resulting in a 409 Conflict error.",
  "root_cause_type": "generic",
  "root_cause_zh": "对StatefulSet的并发更新（例如由控制器或其他用户）导致在应用更改时发生资源版本冲突，从而产生409冲突错误。",
  "versions": [
    {
      "version": "Kubernetes 1.25",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes 1.26",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes 1.27",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Force-applying with `--force` flag does not exist for kubectl apply; it only works for `kubectl replace --force` which can cause data loss.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Retrying the same command without re-fetching the latest object version will hit the same conflict because the resource version is still stale.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Re-fetch the StatefulSet manifest: `kubectl get statefulset my-statefulset -o yaml > statefulset.yaml`. Edit the file, then apply again: `kubectl apply -f statefulset.yaml`. This ensures you have the latest resource version.",
      "success_rate": 0.95,
      "how": "Re-fetch the StatefulSet manifest: `kubectl get statefulset my-statefulset -o yaml > statefulset.yaml`. Edit the file, then apply again: `kubectl apply -f statefulset.yaml`. This ensures you have the latest resource version.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `kubectl patch` with a strategic merge patch to update specific fields without full replace: `kubectl patch statefulset my-statefulset --type='strategic' -p '{\"spec\":{\"replicas\":3}}'`. This avoids version conflicts by using a merge.",
      "success_rate": 0.85,
      "how": "Use `kubectl patch` with a strategic merge patch to update specific fields without full replace: `kubectl patch statefulset my-statefulset --type='strategic' -p '{\"spec\":{\"replicas\":3}}'`. This avoids version conflicts by using a merge.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "重新获取StatefulSet清单：`kubectl get statefulset my-statefulset -o yaml > statefulset.yaml`。编辑文件，然后重新应用：`kubectl apply -f statefulset.yaml`。这确保您拥有最新的资源版本。",
    "使用`kubectl patch`进行策略合并补丁以更新特定字段，无需完全替换：`kubectl patch statefulset my-statefulset --type='strategic' -p '{\"spec\":{\"replicas\":3}}'`。这通过合并避免版本冲突。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kubernetes.io/docs/concepts/architecture/garbage-collection/",
  "official_doc_section": null,
  "error_code": "409",
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-02-28",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}