{"record":{"id":"24304e803e2b1829","repo":"apache/seatunnel","slug":"savepoint-and-restore-with-checkpoint-are-mutu","errorCode":null,"errorMessage":"--savepoint and --restore-with-checkpoint are mutually exclusive","messagePattern":"--savepoint and --restore-with-checkpoint are mutually exclusive","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/args/ClientCommandArgs.java","lineNumber":174,"sourceCode":"            names = {\"--async\"},\n            description =\n                    \"Run the job asynchronously, when the job is submitted, the client will exit\")\n    private boolean async = false;\n\n    @Parameter(\n            names = {\"-cj\", \"--close\", \"--close-job\"},\n            description = \"Close client the task will also be closed\")\n    private boolean closeJob = true;\n\n    @Override\n    public Command<?> buildCommand() {\n        validateCommandOptions();\n        if (restoreJobId != null && restoreWithCheckpointJobId != null) {\n            throw new IllegalArgumentException(\n                    \"--restore and --restore-with-checkpoint are mutually exclusive\");\n        }\n        if (savePointJobId != null && restoreWithCheckpointJobId != null) {\n            throw new IllegalArgumentException(\n                    \"--savepoint and --restore-with-checkpoint are mutually exclusive\");\n        }\n        if (restoreWithCheckpointJobId != null) {\n            restoreWithCheckpointJobId =\n                    normalizeNumericJobId(\n                            restoreWithCheckpointJobId,\n                            \"restoreSourceJobId is required when using --restore-with-checkpoint\",\n                            \"--restore-with-checkpoint requires a numeric jobId, got: \");\n        }\n        if (customJobId != null) {\n            customJobId =\n                    normalizeNumericJobId(\n                            customJobId,\n                            \"--set-job-id requires a non-blank jobId\",\n                            \"--set-job-id requires a numeric jobId, got: \");\n        }\n        Common.setDeployMode(getDeployMode());\n        if (dryRun == DryRun.SAMPLE) {","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/args/ClientCommandArgs.java#L156-L192","documentation":"ClientCommandArgs.buildCommand rejects passing --savepoint together with --restore-with-checkpoint. Restoring with checkpoint semantics already involves savepoint state handling, so the combination is ambiguous and is rejected as IllegalArgumentException at argument-validation time.","triggerScenarios":"Submitting a job with both --savepoint <jobId> (trigger savepoint/stop) and --restore-with-checkpoint <jobId> on the command line, or setting both fields on ClientCommandArgs before buildCommand().","commonSituations":"Scripts chaining a savepoint stop and a checkpoint-based restore in one invocation; misunderstanding --savepoint as an alternative restore source.","solutions":["Remove --savepoint when using --restore-with-checkpoint; they must run as separate commands","First run the savepoint/stop command, then submit a new job with --restore or --restore-with-checkpoint only","Audit wrapper scripts that combine job-stop and job-restore flags"],"exampleFix":"// before\n--savepoint 12345 --restore-with-checkpoint 12345\n// after\n--restore-with-checkpoint 12345","handlingStrategy":"validation","validationCode":"if (cliArgs.contains(\"--savepoint\") && cliArgs.stream().anyMatch(a -> a.startsWith(\"--restore-with-checkpoint\"))) {\n    throw new IllegalArgumentException(\"--savepoint cannot be combined with --restore-with-checkpoint\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    client.submit(args);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"--savepoint and --restore-with-checkpoint\")) {\n        log.error(\"Run savepoint and restore as separate commands\");\n    }\n}","preventionTips":["Use --savepoint only to stop/savepoint a running job","Use --restore-with-checkpoint alone when resubmitting from checkpoint","Keep job-stop and job-restore in separate script invocations"],"tags":["cli","savepoint","validation"],"backgroundTag":"mutually-exclusive-flags","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"}