{
  "id": "cloud/azure-storage-blob-lease-conflict-while-deleting",
  "signature": "409 Conflict: There is currently a lease on the blob 'container/blob.txt'. No lease ID was specified in the request.",
  "signature_zh": "409 冲突：Blob 'container/blob.txt' 当前有租约。请求中未指定租约 ID。",
  "regex": "409 Conflict.*lease on the blob.*No lease ID",
  "domain": "cloud",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "The blob has an active lease (e.g., infinite or finite) that must be released or specified in the delete request, but the operation attempted to delete without providing the lease ID.",
  "root_cause_type": "generic",
  "root_cause_zh": "Blob 具有活动租约（例如，无限期或有限期），必须在删除请求中释放或指定租约 ID，但操作尝试删除时未提供租约 ID。",
  "versions": [
    {
      "version": "azure_cli",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "storage_sdk",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "blob_service",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If the lease is infinite (never expires), waiting won't help; you must break it explicitly.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The portal also requires lease ID for leased blobs; it will show the same error.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Break the lease first using Azure CLI: `az storage blob lease break --account-name mystorageaccount --container-name container --name blob.txt --lease-break-period 30`. Then delete: `az storage blob delete --account-name mystorageaccount --container-name container --name blob.txt`",
      "success_rate": 0.95,
      "how": "Break the lease first using Azure CLI: `az storage blob lease break --account-name mystorageaccount --container-name container --name blob.txt --lease-break-period 30`. Then delete: `az storage blob delete --account-name mystorageaccount --container-name container --name blob.txt`",
      "condition": "",
      "sources": []
    },
    {
      "action": "In code (Python SDK), get the lease ID and delete: `from azure.storage.blob import BlobClient; blob = BlobClient.from_connection_string(conn_str, container_name=\"container\", blob_name=\"blob.txt\"); lease = blob.acquire_lease(); blob.delete_blob(lease=lease)`",
      "success_rate": 0.9,
      "how": "In code (Python SDK), get the lease ID and delete: `from azure.storage.blob import BlobClient; blob = BlobClient.from_connection_string(conn_str, container_name=\"container\", blob_name=\"blob.txt\"); lease = blob.acquire_lease(); blob.delete_blob(lease=lease)`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Break the lease first using Azure CLI: `az storage blob lease break --account-name mystorageaccount --container-name container --name blob.txt --lease-break-period 30`. Then delete: `az storage blob delete --account-name mystorageaccount --container-name container --name blob.txt`",
    "In code (Python SDK), get the lease ID and delete: `from azure.storage.blob import BlobClient; blob = BlobClient.from_connection_string(conn_str, container_name=\"container\", blob_name=\"blob.txt\"); lease = blob.acquire_lease(); blob.delete_blob(lease=lease)`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob",
  "official_doc_section": null,
  "error_code": "409",
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2023-07-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}