{"record":{"id":"e63e61351c883820","repo":"apache/seatunnel","slug":"sample-dry-run-mode-cannot-be-combined-with-valida","errorCode":null,"errorMessage":"Sample dry-run mode cannot be combined with validation, job control, restore, savepoint, encryption, or decryption options.","messagePattern":"Sample dry-run mode cannot be combined with validation, job control, restore, savepoint, encryption, or decryption options\\.","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":293,"sourceCode":"        }\n        if (async) {\n            throw new ParameterException(\"Sample dry-run mode does not support --async.\");\n        }\n        if (restoreJobId != null\n                || restoreWithCheckpointJobId != null\n                || savePointJobId != null\n                || checkConfig\n                || listJob\n                || getRunningJobMetrics\n                || jobId != null\n                || cancelJobId != null\n                || forceCancelJobId != null\n                || metricsJobId != null\n                || checkpointOverviewJobId != null\n                || checkpointHistoryJobId != null\n                || encrypt\n                || decrypt) {\n            throw new ParameterException(\n                    \"Sample dry-run mode cannot be combined with validation, job control, restore, savepoint, encryption, or decryption options.\");\n        }\n    }\n\n    private void validateSampleOptions() {\n        if (dryRun != DryRun.SAMPLE && (sampleLimit != null || samplePrintData)) {\n            throw new ParameterException(\n                    \"--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) {","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/args/ClientCommandArgs.java#L275-L311","documentation":"validateSampleMode() throws this ParameterException when --dry-run sample appears together with any validation/job-control/restore/savepoint/encrypt/decrypt option (e.g. --check-config, --list-job, --restore-job-id, --savepoint-job-id, --encrypt, --decrypt). Sample mode only executes a local sample run, so these mutually exclusive operations are rejected.","triggerScenarios":"Command lines like `--dry-run sample --check-config`, `--dry-run sample --list-job`, `--dry-run sample --restore-job-id 123`, or `--dry-run sample --encrypt`.","commonSituations":"Combining a dry-run with a config-validation or job-management workflow; over-stuffed wrapper scripts that always pass job-control flags.","solutions":["Split the operations into separate commands: one for sample dry-run, one for job control/validation","Remove any --restore-*, --savepoint, --check-config, --list-job, --metrics-job-id, --encrypt/--decrypt flags from the sample dry-run command"],"exampleFix":"// before\n--dry-run sample --check-config --encrypt\n// after\nseatunnel.sh --dry-run sample -c job.conf\nseatunnel.sh --check-config -c job.conf","handlingStrategy":"validation","validationCode":"const INCOMPATIBLE = ['--check-config','--list-job','--restore-job-id','--restore-with-checkpoint-job-id','--savepoint-job-id','--cancel-job-id','--force-cancel-job-id','--metrics-job-id','--checkpoint-overview-job-id','--checkpoint-history-job-id','--encrypt','--decrypt'];\nif (dryRun === 'sample' && args.some(a => INCOMPATIBLE.includes(a))) {\n  throw new Error('--dry-run sample cannot be combined with validation/job-control/restore/savepoint/encrypt/decrypt options');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run sample dry-runs as standalone commands","Do not merge dry-run flags into job-management scripts","Review the full command line for job-control flags before adding --dry-run sample"],"tags":["cli","dry-run","mutually-exclusive"],"backgroundTag":"mutually-exclusive-options","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"}