{"record":{"id":"edfee870a5912ca4","repo":"apache/hadoop","slug":"fns-blob-delete-was-not-successful-for-path","errorCode":null,"errorMessage":"FNS-Blob delete was not successful for path: {}","messagePattern":"FNS-Blob delete was not successful for path: (.+?)","errorType":"http","errorClass":"AbfsRestOperationException","httpStatus":500,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java","lineNumber":1391,"sourceCode":"   * @return executed rest operation containing response from server.\n   * @throws AzureBlobFileSystemException if rest operation fails.\n   */\n  @Override\n  public AbfsRestOperation deletePath(final String path,\n      final boolean recursive,\n      final String continuation,\n      final TracingContext tracingContext) throws AzureBlobFileSystemException {\n    BlobDeleteHandler blobDeleteHandler = getBlobDeleteHandler(path, recursive,\n        tracingContext);\n    if (blobDeleteHandler.execute()) {\n      final AbfsUriQueryBuilder abfsUriQueryBuilder\n          = createDefaultUriQueryBuilder();\n      final URL url = createRequestUrl(path, abfsUriQueryBuilder.toString());\n      final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders();\n      return getSuccessOp(AbfsRestOperationType.DeletePath,\n          HTTP_METHOD_DELETE, url, requestHeaders);\n    } else {\n      throw new AbfsRestOperationException(HTTP_INTERNAL_ERROR,\n          AzureServiceErrorCode.UNKNOWN.getErrorCode(),\n          ERR_DELETE_BLOB + path,\n          null);\n    }\n  }\n\n  @VisibleForTesting\n  public BlobDeleteHandler getBlobDeleteHandler(final String path,\n      final boolean recursive,\n      final TracingContext tracingContext) {\n    return new BlobDeleteHandler(new Path(path), recursive, this,\n        tracingContext);\n  }\n\n  /**\n   * Set the owner of the file or directory.\n   * Not supported for HNS-Disabled Accounts.\n   * @param path on which owner has to be set.","sourceCodeStart":1373,"sourceCodeEnd":1409,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java#L1373-L1409","documentation":"On non-HNS accounts, deletion is orchestrated by BlobDeleteHandler (enumerate blobs, delete each). If handler.execute() returns false, AbfsBlobClient throws a client-synthesized AbfsRestOperationException with HTTP 500, AzureServiceErrorCode.UNKNOWN and message 'FNS-Blob delete was not successful for path: <path>'. As with rename, the 500 is generated by the driver; the actual per-blob failure (lease, permission, throttle) appears in the handler's logs.","triggerScenarios":"fs.delete(path, recursive) on a flat-namespace account when listing or any individual blob delete fails: an active blob lease, a SAS token without delete scope, transient 5xx/429 responses, or concurrent writers recreating blobs during a recursive delete.","commonSituations":"Deleting trees while writers still hold leases or write; least-privilege SAS credentials; mass deletions triggering throttling; cleanup racing job retries.","solutions":["Inspect the driver logs for the per-blob error the handler recorded and fix that root cause (break leases, widen the token scope)","Retry the delete — partially deleted trees make forward progress on each attempt","Quiesce concurrent writers on the subtree before recursive delete","Back off if metrics show throttling during bulk deletion"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (!fs.exists(p)) return true; // already gone\nfs.delete(p, true);","typeGuard":null,"tryCatchPattern":"try {\n  fs.delete(p, true);\n} catch (AbfsRestOperationException e) {\n  // handler logged the per-blob cause (lease/permission/throttle);\n  // fix that, then retry — recursive deletes make progress each round\n}","preventionTips":["Break blob leases before deleting trees that writers touched","Ensure SAS tokens carry delete permission for the whole subtree","Quiesce writers before recursive deletes; back off under throttling"],"tags":["azure","abfs","delete","blob-endpoint","lease","hadoop"],"backgroundTag":"blob-delete-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}