{"record":{"id":"074daefc56f11a5b","repo":"apache/seatunnel","slug":"unsupported-clickhouse-file-copy-method-type","errorCode":null,"errorMessage":"unsupported clickhouse file copy method:\" + type","messagePattern":"unsupported clickhouse file copy method:\" \\+ type","errorType":"validation","errorClass":"ClickhouseConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/file/FileTransferFactory.java","lineNumber":37,"sourceCode":"\nimport org.apache.seatunnel.common.exception.CommonErrorCodeDeprecated;\nimport org.apache.seatunnel.connectors.seatunnel.clickhouse.config.ClickhouseFileCopyMethod;\nimport org.apache.seatunnel.connectors.seatunnel.clickhouse.exception.ClickhouseConnectorException;\n\npublic class FileTransferFactory {\n    public static FileTransfer createFileTransfer(\n            ClickhouseFileCopyMethod type,\n            String host,\n            String user,\n            String password,\n            String keyPath) {\n        switch (type) {\n            case SCP:\n                return new ScpFileTransfer(host, user, password, keyPath);\n            case RSYNC:\n                return new RsyncFileTransfer(host, user, password, keyPath);\n            default:\n                throw new ClickhouseConnectorException(\n                        CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                        \"unsupported clickhouse file copy method:\" + type);\n        }\n    }\n}\n","sourceCodeStart":19,"sourceCodeEnd":43,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/file/FileTransferFactory.java#L19-L43","documentation":"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>\".","triggerScenarios":"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\").","commonSituations":"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.","solutions":["Set the file copy method config value to exactly SCP or RSYNC","Fix case/typo — the switch matches the enum constant spelling","Use SCP (default) if you need a generic secure copy; SFTP is not supported"],"exampleFix":"// before\nfile_method = \"sftp\"\n// after\nfile_method = \"SCP\"","handlingStrategy":"validation","validationCode":"String method = config.get(\"file_method\");\nif (method != null && !method.equals(\"SCP\") && !method.equals(\"RSYNC\")) {\n    throw new IllegalArgumentException(\"file_method must be SCP or RSYNC, got: \" + method);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only configure SCP or RSYNC for the file sink copy method","Match the exact casing of the enum constant","Consult connector docs for the supported method list"],"tags":["config-validation","clickhouse","enum"],"backgroundTag":"invalid-enum-value","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"}