{"record":{"id":"5cfabaed422bd853","repo":"apache/seatunnel","slug":"not-supported","errorCode":null,"errorMessage":"Not supported","messagePattern":"Not supported","errorType":"exception","errorClass":"IOException","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":408,"sourceCode":"                                    \"Could not complete transfer, Reply Code - \"\n                                            + client.getReplyCode());\n                        }\n                    }\n                };\n        if (!FTPReply.isPositivePreliminary(client.getReplyCode())) {\n            // The ftpClient is an inconsistent state. Must close the stream\n            // which in turn will logout and disconnect from FTP server\n            fos.close();\n            throw new IOException(\"Unable to create file: \" + file + \", Aborting\");\n        }\n        return fos;\n    }\n\n    /** This optional operation is not yet supported. */\n    @Override\n    public FSDataOutputStream append(Path f, int bufferSize, Progressable progress)\n            throws IOException {\n        throw new IOException(\"Not supported\");\n    }\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     * @throws IOException on IO problems other than FileNotFoundException\n     */\n    private boolean exists(FTPClient client, Path file) throws IOException {\n        try {\n            return getFileStatus(client, file) != null;\n        } catch (FileNotFoundException fnfe) {\n            LOG.debug(\"File does not exist: \" + file, fnfe);\n            return false;\n        }\n    }\n","sourceCodeStart":390,"sourceCodeEnd":426,"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#L390-L426","documentation":"SeaTunnelFTPFileSystem explicitly does not implement append(); any call throws this IOException. The FTP-backed filesystem only supports creating new files and overwriting, not appending to an existing file.","triggerScenarios":"Calling fs.append(path, bufferSize, progress) on a SeaTunnelFTPFileSystem instance, e.g. from code that assumes Hadoop-compatible append semantics or a sink configured in append mode.","commonSituations":"Streaming writes that rely on append to an existing file on FTP; migrating a job from HDFS (which supports append) to the FTP connector; sink configurations that set append/write-mode options.","solutions":["Rewrite the logic to create a new file per run instead of appending","Buffer data locally and write a complete new file via fs.create(path, overwrite=true)","Switch to a filesystem/connector that supports append (e.g. HDFS, S3 with appropriate setup)","Check the connector's write-mode configuration and remove append-oriented settings"],"exampleFix":"// before\nFSDataOutputStream out = fs.append(path);\nout.write(data);\n// after\nFSDataOutputStream out = fs.create(path, true); // overwrite instead of append\nout.write(data);","handlingStrategy":"fallback","validationCode":"// detect append support before calling\nboolean supportsAppend = !(fs instanceof org.apache.seatunnel.connectors.seatunnel.file.ftp.system.SeaTunnelFTPFileSystem);","typeGuard":"boolean supportsAppend(org.apache.hadoop.fs.FileSystem fs) {\n    return !(fs instanceof org.apache.seatunnel.connectors.seatunnel.file.ftp.system.SeaTunnelFTPFileSystem);\n}","tryCatchPattern":"try {\n    out = fs.append(path);\n} catch (IOException e) {\n    if (e.getMessage().equals(\"Not supported\")) {\n        out = fs.create(path, true); // fallback: rewrite file instead of appending\n    } else { throw e; }\n}","preventionTips":["Never design FTP-connector pipelines around append semantics","Buffer locally and write one complete file per run","Avoid reusing HDFS-specific append code paths with the FTP filesystem"],"tags":["ftp","unsupported-operation","append","hadoop"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}