apache/seatunnel · error · IOException

Not supported

Error message

Not supported

What it means

SFTPFileSystem.append() is not implemented: this filesystem only supports creating new files and overwriting, not appending to an existing remote file. Any call throws IOException with the constant message 'Not supported'.

Solutions

  1. Do not use append with SFTPFileSystem; write to a new file instead.
  2. Configure the writer to overwrite the file rather than append, or delete the target file before writing.
  3. Write to a local/HDFS filesystem that supports append, then upload the complete file via SFTP if incremental append is required.
  4. Check framework sink config for an append/overwrite option and set it appropriately.

Example fix

// before
FSDataOutputStream out = sftpFs.append(path, 4096, () -> {});
// after
FSDataOutputStream out = sftpFs.create(path, true); // overwrite instead of append
Defensive patterns

Strategy: fallback

Validate before calling

// SFTPFileSystem never supports append; check mode before choosing FS
if (writeMode == WriteMode.APPEND) { /* use a filesystem that supports append */ }

Try / catch

try { out = fs.append(path, buf, progress); }
catch (IOException e) {
    if ("Not supported".equals(e.getMessage())) { out = fs.create(path, true); }
    else throw e;
}

Prevention

When it happens

Trigger: Calling fs.append(path, bufferSize, progress) on an SFTPFileSystem instance, directly or through a sink/framework configured to append to an existing file.

Common situations: A sink job configured with append/write mode (e.g. overwrite=false and append semantics) writing to an existing SFTP file; migrating code from HDFS (which supports append) to SFTP.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/ab7ccd059bec0dc4. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-sftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sftp/system/SFTPFileSystem.java:570

            if (e instanceof IOException) {
                throw (IOException) e;
            }
            throw new IOException(e);
        }
    }

    private void disconnectAfterFailure(ChannelSftp channel, Exception originalFailure) {
        try {
            disconnect(channel);
        } catch (IOException disconnectFailure) {
            originalFailure.addSuppressed(disconnectFailure);
        }
    }

    @Override
    public FSDataOutputStream append(Path f, int bufferSize, Progressable progress)
            throws IOException {
        throw new IOException(E_NOT_SUPPORTED);
    }

    /*
     * The parent of source and destination can be different. It is suppose to
     * work like 'move'
     */
    @Override
    public boolean rename(Path src, Path dst) throws IOException {
        ChannelSftp channel = connect();
        try {
            boolean success = rename(channel, src, dst);
            return success;
        } finally {
            disconnect(channel);
        }
    }

    @Override

View on GitHub (pinned to cf67b549a7)