apache/seatunnel · error · ClickhouseConnectorException

unsupported clickhouse file copy method:" + type

Error message

unsupported clickhouse file copy method:" + type

What it means

FileTransferFactory.createFileTransfer maps a configured file copy method to a transfer implementation: only SCP and RSYNC are supported. Any other value throws ILLEGAL_ARGUMENT with "unsupported clickhouse file copy method:<type>".

Source

Thrown at seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/file/FileTransferFactory.java:37

import org.apache.seatunnel.common.exception.CommonErrorCodeDeprecated;
import org.apache.seatunnel.connectors.seatunnel.clickhouse.config.ClickhouseFileCopyMethod;
import org.apache.seatunnel.connectors.seatunnel.clickhouse.exception.ClickhouseConnectorException;

public class FileTransferFactory {
    public static FileTransfer createFileTransfer(
            ClickhouseFileCopyMethod type,
            String host,
            String user,
            String password,
            String keyPath) {
        switch (type) {
            case SCP:
                return new ScpFileTransfer(host, user, password, keyPath);
            case RSYNC:
                return new RsyncFileTransfer(host, user, password, keyPath);
            default:
                throw new ClickhouseConnectorException(
                        CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
                        "unsupported clickhouse file copy method:" + type);
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set the file copy method config value to exactly SCP or RSYNC
  2. Fix case/typo — the switch matches the enum constant spelling
  3. Use SCP (default) if you need a generic secure copy; SFTP is not supported

Example fix

// before
file_method = "sftp"
// after
file_method = "SCP"
Defensive patterns

Strategy: validation

Validate before calling

String method = config.get("file_method");
if (method != null && !method.equals("SCP") && !method.equals("RSYNC")) {
    throw new IllegalArgumentException("file_method must be SCP or RSYNC, got: " + method);
}

Prevention

When it happens

Trigger: createFileTransfer called with a `file_method`/copy-type value that is not exactly `SCP` or `RSYNC` in the ClickHouse file sink config (e.g. lowercase "scp", "sftp", "ftp").

Common situations: Users configure `file_method = "sftp"` assuming broader support; case mismatch like "scp" instead of "scp" in the expected enum form; docs/cluster tooling writing an unsupported method.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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