{"record":{"id":"3d521a281b7bbbcc","repo":"apache/seatunnel","slug":"source-path-s-does-not-exist-3d521a","errorCode":null,"errorMessage":"Source path %s does not exist","messagePattern":"Source path (.+?) does not exist","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-sftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sftp/system/SFTPFileSystem.java","lineNumber":445,"sourceCode":"            if (!\".\".equalsIgnoreCase(fname) && !\"..\".equalsIgnoreCase(fname)) {\n                fileStats.add(getFileStatus(client, entry, absolute));\n            }\n        }\n        return fileStats.toArray(new FileStatus[fileStats.size()]);\n    }\n\n    private boolean rename(ChannelSftp channel, Path src, Path dst) throws IOException {\n        Path workDir;\n        try {\n            workDir = new Path(channel.pwd());\n        } catch (SftpException e) {\n            throw new IOException(e);\n        }\n        Path absoluteSrc = makeAbsolute(workDir, src);\n        Path absoluteDst = makeAbsolute(workDir, dst);\n\n        if (!exists(channel, absoluteSrc)) {\n            throw new IOException(String.format(E_SPATH_NOTEXIST, src));\n        }\n        if (exists(channel, absoluteDst)) {\n            throw new IOException(String.format(E_DPATH_EXIST, dst));\n        }\n        boolean renamed = true;\n        try {\n            final String previousCwd = channel.pwd();\n            channel.cd(\"/\");\n            channel.rename(src.toUri().getPath(), dst.toUri().getPath());\n            channel.cd(previousCwd);\n        } catch (SftpException e) {\n            renamed = false;\n        }\n        return renamed;\n    }\n\n    @Override\n    public void initialize(URI uriInfo, Configuration conf) throws IOException {","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-sftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sftp/system/SFTPFileSystem.java#L427-L463","documentation":"rename() checks exists(channel, absoluteSrc) and throws IOException(E_SPATH_NOTEXIST) if the source path is absent. It is a precondition failure: you asked to rename something that is not on the remote filesystem.","triggerScenarios":"fs.rename(src, dst) where src was never created, was already moved/deleted, or the path spelling (relative vs absolute, case) differs from what exists on the server.","commonSituations":"Two-phase commit where the source file was already renamed by a previous attempt; typo in configured path; a prior job step silently failed to write the file; case-sensitivity mismatch.","solutions":["Verify the source exists (fs.exists(src)) before renaming, or make the rename idempotent (skip if dst already exists)","Fix the configured source path","Check whether a previous run/attempt already consumed or moved the file","Ensure the producing step completed successfully before triggering the rename"],"exampleFix":"// before\nfs.rename(src, dst);\n// after\nif (fs.exists(src)) {\n    fs.rename(src, dst);\n}","handlingStrategy":"validation","validationCode":"if (!fs.exists(src)) {\n    throw new IOException(\"Cannot rename, source missing: \" + src);\n}\nif (fs.exists(dst)) {\n    throw new IOException(\"Cannot rename, dst exists: \" + dst);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify source existence before rename","Check for prior attempts that already moved the file","Log the exact absolute paths used to catch typos/case mismatches"],"tags":["sftp","rename","path"],"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"}