{"record":{"id":"690598bce937b93a","repo":"apache/iceberg","slug":"failed-to-delete-path","errorCode":null,"errorMessage":"Failed to delete path: {}","messagePattern":"Failed to delete path: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"azure/src/main/java/org/apache/iceberg/azure/adlsv2/ADLSFileIO.java","lineNumber":117,"sourceCode":"  @Override\n  public InputFile newInputFile(String path, long length) {\n    return new ADLSInputFile(path, length, fileClient(path), azureProperties, metrics);\n  }\n\n  @Override\n  public OutputFile newOutputFile(String path) {\n    return new ADLSOutputFile(path, fileClient(path), azureProperties, metrics);\n  }\n\n  @Override\n  public void deleteFile(String path) {\n    // There is no specific contract about whether delete should fail\n    // and other FileIO providers ignore failure.  Log the failure for\n    // now as it is not a required operation for Iceberg.\n    try {\n      fileClient(path).delete();\n    } catch (RuntimeException e) {\n      LOG.warn(\"Failed to delete path: {}\", path, e);\n    }\n  }\n\n  @Override\n  public Map<String, String> properties() {\n    return properties.immutableMap();\n  }\n\n  public DataLakeFileSystemClient client(String path) {\n    ADLSLocation location = new ADLSLocation(path);\n    return client(location);\n  }\n\n  @VisibleForTesting\n  DataLakeFileSystemClient client(ADLSLocation location) {\n    if (clientCache == null) {\n      synchronized (this) {\n        if (clientCache == null) {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/azure/src/main/java/org/apache/iceberg/azure/adlsv2/ADLSFileIO.java#L99-L135","documentation":"ADLSFileIO.deleteFile() attempts to delete a blob via the DataLakeFileClient. Because Iceberg does not require delete to succeed (other FileIO providers ignore failures), any RuntimeException is caught and logged at WARN with the path instead of being thrown.","triggerScenarios":"Calling FileIO.deleteFile(path) where the ADLS Gen2 path doesn't exist, the credentials lack delete permission, or the storage account is unreachable.","commonSituations":"Retrying deletion of an already-deleted manifest/data file; misconfigured OAuth roles on the storage account; transient ADLS/network errors during cleanup.","solutions":["Verify the path exists and the account key/OAuth identity has Storage Blob Data Contributor (delete) rights","Check ADLS account/endpoint configuration in properties","Confirm the file isn't soft-deleted/leased by another process","Use deleteFiles (bulk) if you need a failure count via BulkDeletionFailureException"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// pre-check existence and permissions before delete\nString account = \"https://<account>.dfs.core.windows.net\";\nDataLakeFileSystemClient fs = new DataLakeFileSystemClientBuilder()\n    .endpoint(account).fileSystemName(fsName).credential(cred).buildFileSystemClient();\nboolean exists = fs.getFileClient(path).exists();\nboolean canDelete = /* verify role assignment 'Storage Blob Data Contributor' */ true;","typeGuard":null,"tryCatchPattern":"try {\n  io.deleteFile(path);\n} catch (RuntimeException e) {\n  // ADLSFileIO itself logs; treat delete as best-effort per Iceberg contract\n  LOG.warn(\"Ignoring best-effort delete failure for {}\", path, e);\n}","preventionTips":["Grant Storage Blob Data Contributor to the workload identity","Check path existence before delete if strictness is required","Watch WARN logs for repeated delete failures indicating misconfiguration"],"tags":["azure","adls","file-delete"],"backgroundTag":"file-delete-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}