{"record":{"id":"83a926226dd6c0b1","repo":"apache/dolphinscheduler","slug":"destination-path-already-exists-dstabsolutepath","errorCode":null,"errorMessage":"Destination path already exists: ${dstAbsolutePath}","messagePattern":"Destination path already exists: (.+?)","errorType":"exception","errorClass":"FileAlreadyExistsException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/local/LocalStorageOperator.java","lineNumber":103,"sourceCode":"            Files.deleteIfExists(Paths.get(resourceAbsolutePath));\n        }\n    }\n\n    @SneakyThrows\n    @Override\n    public void copy(String srcAbsolutePath, String dstAbsolutePath, boolean deleteSource, boolean overwrite) {\n        if (srcAbsolutePath.equals(dstAbsolutePath)) {\n            throw new IllegalArgumentException(\n                    \"Source path and destination path cannot be the same: \" + srcAbsolutePath);\n        }\n\n        if (!exists(srcAbsolutePath)) {\n            throw new FileNotFoundException(\"Source path does not exist: \" + srcAbsolutePath);\n        }\n\n        if (exists(dstAbsolutePath)) {\n            if (!overwrite) {\n                throw new FileAlreadyExistsException(\"Destination path already exists: \" + dstAbsolutePath);\n            }\n            delete(dstAbsolutePath, true);\n        }\n\n        final File srcFile = new File(srcAbsolutePath);\n        final File dstFile = new File(dstAbsolutePath);\n        if (FileUtils.isDirectory(srcFile)) {\n            FileUtils.copyDirectoryToDirectory(srcFile, dstFile);\n        } else {\n            FileUtils.copyFile(srcFile, dstFile);\n        }\n        if (deleteSource) {\n            delete(srcAbsolutePath, true);\n        }\n    }\n\n    @Override\n    public void upload(String srcLocalFileAbsolutePath, String dstAbsolutePath, boolean deleteSource,","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/local/LocalStorageOperator.java#L85-L121","documentation":"A precondition in copy(): the destination path already exists and overwrite=false, so the copy is refused rather than clobbering an existing file or directory. The offending input is dstAbsolutePath; it fires when moving/renaming a resource onto an occupied name or re-uploading to the same destination without the overwrite flag.","triggerScenarios":"Thrown at dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/local/LocalStorageOperator.java:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different destination name, or delete the existing destination first","Pass overwrite=true when overwriting is intended","Pre-check existence in the caller (upload/rename flows) and surface a user-facing conflict message"],"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"}