{"record":{"id":"0cf4e818d1201f57","repo":"apache/seatunnel","slug":"source-path-s-does-not-exist","errorCode":null,"errorMessage":"Source path %s does not exist","messagePattern":"Source path (.+?) does not exist","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/system/SeaTunnelFTPFileSystem.java","lineNumber":834,"sourceCode":"    }\n\n    /**\n     * Convenience method, so that we don't open a new connection when using this method from within\n     * another method. Otherwise every API invocation incurs the overhead of opening/closing a TCP\n     * connection.\n     *\n     * @param client FTPClient\n     * @param src src\n     * @param dst dst\n     * @return result\n     * @throws IOException IOException\n     */\n    private boolean rename(FTPClient client, Path src, Path dst) throws IOException {\n        Path workDir = new Path(client.printWorkingDirectory());\n        Path absoluteSrc = makeAbsolute(workDir, src);\n        Path absoluteDst = makeAbsolute(workDir, dst);\n        if (!exists(client, absoluteSrc)) {\n            throw new FileNotFoundException(\"Source path \" + src + \" does not exist\");\n        }\n        if (isDirectory(absoluteDst)) {\n            // destination is a directory: rename goes underneath it with the\n            // source name\n            absoluteDst = new Path(absoluteDst, absoluteSrc.getName());\n        }\n        if (exists(client, absoluteDst)) {\n            throw new FileAlreadyExistsException(\"Destination path \" + dst + \" already exists\");\n        }\n        if (isParentOf(absoluteSrc, absoluteDst)) {\n            throw new IOException(\n                    \"Cannot rename \" + absoluteSrc + \" under itself\" + \" : \" + absoluteDst);\n        }\n        String from = absoluteSrc.toUri().getPath();\n        String to = absoluteDst.toUri().getPath();\n        return client.rename(from, to);\n    }\n","sourceCodeStart":816,"sourceCodeEnd":852,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/system/SeaTunnelFTPFileSystem.java#L816-L852","documentation":"During rename, SeaTunnelFTPFileSystem first absolutizes the source and destination paths against the FTP working directory, then verifies the source exists. If it does not, a FileNotFoundException with 'Source path %s does not exist' is thrown instead of attempting an FTP RENAME that would fail opaquely.","triggerScenarios":"rename(client, src, dst) is called and exists(client, absoluteSrc) returns false — the source path (made absolute against client.printWorkingDirectory()) is not present on the FTP server.","commonSituations":"Typo or wrong case in the source path (FTP paths are case-sensitive); file was already moved/deleted by another process or a previous job run; relative path resolved against an unexpected working directory; staging/temp file was never written because an earlier step failed.","solutions":["Verify the source path exists on the FTP server (ls the parent directory) and matches case exactly","Check whether the file was consumed/deleted by a prior job or another concurrent process","Confirm the FTP user's home/working directory matches your assumption; use absolute paths starting with '/'","Ensure the upstream step that creates the file completed successfully before rename runs","If using relative paths, log client.printWorkingDirectory() at job start to see the resolution base"],"exampleFix":"// before\nftpFileSystem.rename(new Path(\"Data/file.txt\"), dst); // wrong case\n// after\nPath src = new Path(\"/data/file.txt\");\nif (!ftpFileSystem.exists(src)) {\n    throw new FileNotFoundException(\"Pre-check failed: \" + src);\n}\nftpFileSystem.rename(src, dst);","handlingStrategy":"validation","validationCode":"// Java: pre-check source existence before rename\nPath src = new Path(\"/data/file.txt\");\nif (!ftpFileSystem.exists(src)) {\n    throw new FileNotFoundException(\"Rename aborted, missing source: \" + src);\n}","typeGuard":null,"tryCatchPattern":"try {\n    fs.rename(src, dst);\n} catch (FileNotFoundException e) {\n    logger.warn(\"Rename source missing (already moved/consumed?): {}\", src);\n}","preventionTips":["Always use absolute FTP paths","Check that upstream steps that create the file completed successfully","Avoid concurrent jobs moving the same files","Remember FTP paths are case-sensitive"],"tags":["ftp","file-not-found","rename"],"backgroundTag":"file-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}