apache/dolphinscheduler · error · FileAlreadyExistsException
directory: ${objectName} already exists
Error message
directory: ${objectName} already exists What it means
A sentinel guard in the Azure Blob Storage operator: createStorageDir checked and found the target directory (objectName = directory + FOLDER_SEPARATOR) already present in the container, so it refuses to 'create' it again. It fires for any resource-directory creation whose target already exists — e.g. re-uploading after a partial run — rather than an Azure service failure; the offending input is the directory path.
Source
Thrown at dolphinscheduler-storage-plugin/dolphinscheduler-storage-abs/src/main/java/org/apache/dolphinscheduler/plugin/storage/abs/AbsStorageOperator.java:89
}
@Override
public String getStorageBaseDirectory() {
// All directory should end with File.separator
if (getStorageBaseDirectory().startsWith("/")) {
log.warn("{} -> {} should not start with / in abs", StorageConstants.RESOURCE_UPLOAD_PATH,
getStorageBaseDirectory());
return getStorageBaseDirectory().substring(1);
}
return getStorageBaseDirectory();
}
@SneakyThrows
@Override
public void createStorageDir(String directory) {
String objectName = directory + FOLDER_SEPARATOR;
if (isObjectExists(objectName)) {
throw new FileAlreadyExistsException("directory: " + objectName + " already exists");
}
BlobClient blobClient = blobContainerClient.getBlobClient(objectName);
blobClient.upload(new ByteArrayInputStream(EMPTY_STRING.getBytes()), 0);
}
@SneakyThrows
@Override
public void download(String srcFilePath, String dstFilePath, boolean overwrite) {
File dstFile = new File(dstFilePath);
if (dstFile.isDirectory()) {
Files.delete(dstFile.toPath());
} else {
FileUtils.createDirectoryWithPermission(dstFile.getParentFile().toPath(), FileUtils.PERMISSION_755);
}
BlobClient blobClient = blobContainerClient.getBlobClient(srcFilePath);
blobClient.downloadToFile(dstFilePath, true);
}View on GitHub (pinned to 02eac45a1b)
Solutions
- Treat the condition as idempotent success when re-creating an existing resource directory
- Before calling createStorageDir, check existence and skip creation
- Delete the stale directory in the ABS container if a clean re-upload is required
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at dolphinscheduler-storage-plugin/dolphinscheduler-storage-abs/src/main/java/org/apache/dolphinscheduler/plugin/storage/abs/AbsStorageOperator.java:89 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/a6581126fd35edb3.
Report an issue: GitHub.