{"record":{"id":"a6581126fd35edb3","repo":"apache/dolphinscheduler","slug":"directory-objectname-already-exists","errorCode":null,"errorMessage":"directory: ${objectName} already exists","messagePattern":"directory: (.+?) already exists","errorType":"exception","errorClass":"FileAlreadyExistsException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-storage-plugin/dolphinscheduler-storage-abs/src/main/java/org/apache/dolphinscheduler/plugin/storage/abs/AbsStorageOperator.java","lineNumber":89,"sourceCode":"    }\n\n    @Override\n    public String getStorageBaseDirectory() {\n        // All directory should end with File.separator\n        if (getStorageBaseDirectory().startsWith(\"/\")) {\n            log.warn(\"{} -> {} should not start with / in abs\", StorageConstants.RESOURCE_UPLOAD_PATH,\n                    getStorageBaseDirectory());\n            return getStorageBaseDirectory().substring(1);\n        }\n        return getStorageBaseDirectory();\n    }\n\n    @SneakyThrows\n    @Override\n    public void createStorageDir(String directory) {\n        String objectName = directory + FOLDER_SEPARATOR;\n        if (isObjectExists(objectName)) {\n            throw new FileAlreadyExistsException(\"directory: \" + objectName + \" already exists\");\n        }\n        BlobClient blobClient = blobContainerClient.getBlobClient(objectName);\n        blobClient.upload(new ByteArrayInputStream(EMPTY_STRING.getBytes()), 0);\n    }\n\n    @SneakyThrows\n    @Override\n    public void download(String srcFilePath, String dstFilePath, boolean overwrite) {\n        File dstFile = new File(dstFilePath);\n        if (dstFile.isDirectory()) {\n            Files.delete(dstFile.toPath());\n        } else {\n            FileUtils.createDirectoryWithPermission(dstFile.getParentFile().toPath(), FileUtils.PERMISSION_755);\n        }\n\n        BlobClient blobClient = blobContainerClient.getBlobClient(srcFilePath);\n        blobClient.downloadToFile(dstFilePath, true);\n    }","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-storage-plugin/dolphinscheduler-storage-abs/src/main/java/org/apache/dolphinscheduler/plugin/storage/abs/AbsStorageOperator.java#L71-L107","documentation":"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.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}