{
  "id": "cloud/gcp-cloud-storage-bucket-object-versioning-conflict",
  "signature": "409 Conflict: The object version you are trying to delete is not the latest version.",
  "signature_zh": "409 Conflict：您尝试删除的对象版本不是最新版本。",
  "regex": "409 Conflict.*object version.*not the latest version",
  "domain": "cloud",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "When bucket versioning is enabled, deleting a non-latest object version requires specifying the generation number; otherwise Cloud Storage returns a 409 conflict.",
  "root_cause_type": "generic",
  "root_cause_zh": "当存储桶启用版本控制时，删除非最新对象版本需要指定代次编号，否则Cloud Storage返回409冲突。",
  "versions": [
    {
      "version": "GCS JSON API v1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Google Cloud Storage Client Library 2.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gsutil 5.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If bucket versioning is enabled, the API requires generation for deleting a specific version; the error persists.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling versioning does not delete existing versions; you must suspend versioning and then delete each version separately.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "gsutil rm without -a only deletes the live version; non-current versions remain and cause conflict errors.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use gsutil with generation number: `gsutil rm gs://bucket-name/object#<generation-number>`. To find generation numbers: `gsutil ls -la gs://bucket-name/object`.",
      "success_rate": 0.95,
      "how": "Use gsutil with generation number: `gsutil rm gs://bucket-name/object#<generation-number>`. To find generation numbers: `gsutil ls -la gs://bucket-name/object`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Delete all versions of an object: `gsutil rm -a gs://bucket-name/object` (the -a flag removes all versions).",
      "success_rate": 0.98,
      "how": "Delete all versions of an object: `gsutil rm -a gs://bucket-name/object` (the -a flag removes all versions).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use gsutil with generation number: `gsutil rm gs://bucket-name/object#<generation-number>`. To find generation numbers: `gsutil ls -la gs://bucket-name/object`.",
    "Delete all versions of an object: `gsutil rm -a gs://bucket-name/object` (the -a flag removes all versions)."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cloud.google.com/storage/docs/deleting-objects#delete-object-noncurrent",
  "official_doc_section": null,
  "error_code": "409",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-08-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}