{"record":{"id":"53fd21cc4464e77b","repo":"apache/seatunnel","slug":"common-illegal-argument","errorCode":"COMMON_ILLEGAL_ARGUMENT","errorMessage":"Unknown ClickhouseFileCopyMethod: ","messagePattern":"Unknown ClickhouseFileCopyMethod: ","errorType":"error_code","errorClass":"ClickhouseConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/config/ClickhouseFileCopyMethod.java","lineNumber":44,"sourceCode":"    ;\n    private final String name;\n\n    ClickhouseFileCopyMethod(String name) {\n        this.name = name;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public static ClickhouseFileCopyMethod from(String name) {\n        for (ClickhouseFileCopyMethod clickhouseFileCopyMethod :\n                ClickhouseFileCopyMethod.values()) {\n            if (clickhouseFileCopyMethod.getName().equalsIgnoreCase(name)) {\n                return clickhouseFileCopyMethod;\n            }\n        }\n        throw new ClickhouseConnectorException(\n                CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                \"Unknown ClickhouseFileCopyMethod: \" + name);\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":49,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/config/ClickhouseFileCopyMethod.java#L26-L49","documentation":"ClickhouseFileCopyMethod.from(name) resolves the user-supplied file_copy_method option string into the enum by case-insensitive comparison. If no enum constant matches, it throws ClickhouseConnectorException with code COMMON_ILLEGAL_ARGUMENT naming the bad value. The valid values are the names declared by the enum (e.g. upload, s3, scp...).","triggerScenarios":"Setting the ClickHouse file connector option 'file_copy_method' (or passing a name to ClickhouseFileCopyMethod.from) with a value that does not match any enum constant's name, e.g. a typo like 'S3 ' or 's3cp', or an old/renamed method name.","commonSituations":"Config typo in the HOCON job file; copying an option value from another connector that uses different method names; upgrading SeaTunnel where a method name changed; whitespace or casing mistakes in hand-written configs.","solutions":["Set file_copy_method to one of the exact enum names (check ClickhouseFileCopyMethod for the current valid set).","Fix typos and strip surrounding whitespace from the config value.","If migrating from an older version, map the old method name to its current enum name.","Wrap option parsing so a ClickhouseConnectorException surfaces the accepted values in the error message for the user."],"exampleFix":"// before\nfile_copy_method = \"S3cp\"\n// after\nfile_copy_method = \"s3\"","handlingStrategy":"validation","validationCode":"Set<String> valid = Arrays.stream(ClickhouseFileCopyMethod.values()).map(ClickhouseFileCopyMethod::getName).collect(Collectors.toSet());\nif (!valid.contains(name.trim())) { throw new IllegalArgumentException(\"file_copy_method must be one of \" + valid); }","typeGuard":null,"tryCatchPattern":"try { method = ClickhouseFileCopyMethod.from(rawName.trim()); } catch (ClickhouseConnectorException e) { log.error(\"Invalid file_copy_method '{}'; valid values: {}\", rawName, Arrays.toString(ClickhouseFileCopyMethod.values())); throw e; }","preventionTips":["Copy option values only from official connector docs, not other connectors.","Trim and normalize user input before calling from().","When enum names change across versions, grep the enum source for current values during upgrades."],"tags":["clickhouse","config","enum","illegal-argument"],"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-14T05:17:10.506Z"}