{"record":{"id":"483a12183dadb32a","repo":"apache/seatunnel","slug":"name-must-be-an-integer","errorCode":null,"errorMessage":"${name} must be an integer.","messagePattern":"(.+?) must be an integer\\.","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/args/ClientCommandArgs.java","lineNumber":319,"sourceCode":"                    \"--sample-limit and --sample-print-data require --dry-run sample.\");\n        }\n    }\n\n    /** Validates that a sample limit is between 1 and {@link DryRunSampleConfig#MAX_LIMIT}. */\n    public static class PositiveIntegerValidator implements IParameterValidator {\n        @Override\n        public void validate(String name, String value) throws ParameterException {\n            try {\n                int limit = Integer.parseInt(value);\n                if (limit < 1) {\n                    throw new ParameterException(name + \" must be greater than zero.\");\n                }\n                if (limit > DryRunSampleConfig.MAX_LIMIT) {\n                    throw new ParameterException(\n                            name + \" must not exceed \" + DryRunSampleConfig.MAX_LIMIT + \".\");\n                }\n            } catch (NumberFormatException e) {\n                throw new ParameterException(name + \" must be an integer.\", e);\n            }\n        }\n    }\n\n    public static class SeaTunnelMasterTargetConverter implements IStringConverter<MasterType> {\n        private static final List<MasterType> MASTER_TYPE_LIST = new ArrayList<>();\n\n        static {\n            MASTER_TYPE_LIST.add(MasterType.LOCAL);\n            MASTER_TYPE_LIST.add(MasterType.CLUSTER);\n        }\n\n        @Override\n        public MasterType convert(String value) {\n            MasterType masterType = MasterType.valueOf(value.toUpperCase());\n            if (MASTER_TYPE_LIST.contains(masterType)) {\n                return masterType;\n            } else {","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/args/ClientCommandArgs.java#L301-L337","documentation":"PositiveIntegerValidator throws this ParameterException (wrapping the NumberFormatException) when --sample-limit is not a parseable integer. This is the standard picocli IParameterValidator flow invoked before command execution.","triggerScenarios":"Running `--sample-limit abc`, `--sample-limit 3.5`, `--sample-limit ''`, or a value with stray whitespace/units like `10 rows`.","commonSituations":"Quoting mistakes in shell scripts that inject empty values; copy-paste with decimal or unit suffixes; YAML/env interpolation producing non-numeric text.","solutions":["Pass a plain integer value, e.g. --sample-limit 10","Shell-quote properly so the flag doesn't receive an empty string","Check the script/CI variable actually contains a number before substituting it"],"exampleFix":"// before\n--sample-limit \"${LIMIT}\"  # LIMIT='' \n// after\n--sample-limit \"${LIMIT:-10}\"","handlingStrategy":"type-guard","validationCode":"const n = Number(value);\nif (!Number.isInteger(n)) {\n  throw new Error(`--sample-limit must be an integer, got: ${value}`);\n}","typeGuard":"const isIntStr = (v) => typeof v === 'string' && /^\\d+$/.test(v.trim());","tryCatchPattern":"try {\n  seatunnel.run(args);\n} catch (ParameterException e) {\n  if (e.getCause() instanceof NumberFormatException) {\n    // correct the --sample-limit value and retry\n  }\n}","preventionTips":["Ensure CI/env variables substituted into --sample-limit are numeric","Avoid decimals, units, or whitespace in the value","Quote arguments to prevent empty strings reaching the parser"],"tags":["cli","validation","number-format"],"backgroundTag":"invalid-argument-format","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"}