{"record":{"id":"99caf62e45f50fc4","repo":"apache/hadoop","slug":"fns-blob-rename-was-not-successful-for-source-and","errorCode":null,"errorMessage":"FNS-Blob rename was not successful for source and destination path: {} & {}","messagePattern":"FNS-Blob rename was not successful for source and destination 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":866,"sourceCode":"      throws IOException {\n    BlobRenameHandler blobRenameHandler = getBlobRenameHandler(source,\n        destination, sourceEtag, isAtomicRenameKey(source), tracingContext\n    );\n    try {\n      if (blobRenameHandler.execute(false)) {\n        final AbfsUriQueryBuilder abfsUriQueryBuilder\n            = createDefaultUriQueryBuilder();\n        appendSASTokenToQuery(source, SASTokenProvider.RENAME_SOURCE_OPERATION,\n            abfsUriQueryBuilder);\n        final URL url = createRequestUrl(destination,\n            abfsUriQueryBuilder.toString());\n        final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders();\n        final AbfsRestOperation successOp = getSuccessOp(\n            AbfsRestOperationType.RenamePath, HTTP_METHOD_PUT,\n            url, requestHeaders);\n        return new AbfsClientRenameResult(successOp, true, false);\n      } else {\n        throw new AbfsRestOperationException(HTTP_INTERNAL_ERROR,\n            AzureServiceErrorCode.UNKNOWN.getErrorCode(),\n            ERR_RENAME_BLOB + source + SINGLE_WHITE_SPACE + AND_MARK\n                + SINGLE_WHITE_SPACE + destination,\n            null);\n      }\n    } finally {\n      incrementAbfsRenamePath();\n    }\n  }\n\n  @VisibleForTesting\n  BlobRenameHandler getBlobRenameHandler(final String source,\n      final String destination,\n      final String sourceEtag,\n      final boolean isAtomicRename,\n      final TracingContext tracingContext) {\n    return new BlobRenameHandler(source,\n        destination, this, sourceEtag, isAtomicRename, false, tracingContext);","sourceCodeStart":848,"sourceCodeEnd":884,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java#L848-L884","documentation":"On non-HNS accounts, rename is emulated by BlobRenameHandler (copy + delete pipeline). If handler.execute() does not report success, AbfsBlobClient throws a client-synthesized AbfsRestOperationException with HTTP 500, AzureServiceErrorCode.UNKNOWN, and message 'FNS-Blob rename was not successful for source and destination path: <src> & <dst>'. The 500 originates in the driver, not the Azure service — the concrete per-blob cause is in the handler's logs.","triggerScenarios":"fs.rename() on a flat-namespace account where the blob-rename pipeline fails: source blob deleted mid-copy, SAS token lacking copy/delete permissions, unresolvable rename-pending markers, or transient failures inside the handler.","commonSituations":"Rename-heavy workloads on non-HNS accounts (slow and failure-prone); SAS-scoped credentials without delete on source or write on destination; concurrent deletes racing the copy; huge directories with many rename-pending markers.","solutions":["Verify the source path still exists, then retry the rename","Check credential scope: the key/SAS must allow read+delete on source and write on destination","Look at driver logs for the per-blob failure the handler reported and address that specific error","For rename-dominated workloads, move to an HNS-enabled account where rename is an O(1) metadata operation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!fs.exists(srcPath)) {\n  throw new FileNotFoundException(\"rename source missing: \" + srcPath);\n}\nfs.rename(srcPath, dstPath);","typeGuard":null,"tryCatchPattern":"try {\n  fs.rename(src, dst);\n} catch (AbfsRestOperationException e) {\n  // client-synthesized 500 from BlobRenameHandler: check handler logs for per-blob cause,\n  // verify source still exists, then retry with bounded backoff\n}","preventionTips":["Verify credential scope covers read+delete on source and write on destination","Avoid concurrent deletes of the rename source subtree","Prefer HNS-enabled accounts for rename-heavy workloads"],"tags":["azure","abfs","rename","blob-endpoint","hadoop"],"backgroundTag":"blob-rename-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}