{"record":{"id":"e47fabde201e71fd","repo":"apache/seatunnel","slug":"restoresourcejobid-is-required-when-restoremode-e47fab","errorCode":null,"errorMessage":"restoreSourceJobId is required when restoreMode=${restoreMode}","messagePattern":"restoreSourceJobId is required when restoreMode=(.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/JobInfoService.java","lineNumber":467,"sourceCode":"                            validateCheckpointRestoreRequest(requestParams);\n                            SeaTunnelServer seaTunnelServer = getSeaTunnelServer(false);\n                            Config decryptConfig = ConfigShadeUtils.decryptConfig(tuple._2);\n                            return submitJobInternal(\n                                    decryptConfig,\n                                    requestParams,\n                                    seaTunnelServer,\n                                    nodeEngine.getNode());\n                        })\n                .collect(JsonArray::new, JsonArray::add, JsonArray::add);\n    }\n\n    private void validateCheckpointRestoreRequest(Map<String, String> requestParams) {\n        String restoreModeValue = requestParams.get(RestConstant.RESTORE_MODE);\n        RestoreMode restoreMode =\n                restoreModeValue == null ? RestoreMode.NONE : RestoreMode.valueOf(restoreModeValue);\n        if (restoreMode.isRestore()\n                && requestParams.get(RestConstant.RESTORE_SOURCE_JOB_ID) == null) {\n            throw new IllegalArgumentException(\n                    \"restoreSourceJobId is required when restoreMode=\" + restoreMode);\n        }\n    }\n}\n","sourceCodeStart":449,"sourceCodeEnd":472,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/JobInfoService.java#L449-L472","documentation":"When restoreMode is set to a restoring value (e.g. FULL or LATE — anything whose isRestore() is true), the REST API must know which previous job's state to restore from, supplied via restoreSourceJobId. validateCheckpointRestoreRequest throws this IllegalArgumentException when restoreMode requests a restore but restoreSourceJobId is absent.","triggerScenarios":"POST to submit-job (single or batch path) with restoreMode=FULL (or another restore mode) while omitting the restoreSourceJobId parameter.","commonSituations":"Users enabling automatic state restore after a job failure but not recording the failed job's id; configs written with restoreMode set by a template that never injects restoreSourceJobId; confusion between jobId (target job) and restoreSourceJobId (source job) parameters.","solutions":["Add restoreSourceJobId=<id of the job whose savepoint/state to restore> to the request.","Keep restoreMode unset (or NONE) if no state restore is desired.","Fetch the finished/failed job's id via the REST finished-jobs endpoint before resubmitting."],"exampleFix":"// before\ncurl -X POST 'http://host:8080/submit-job?jobName=demo&restoreMode=FULL' --data @job.conf\n// after\ncurl -X POST 'http://host:8080/submit-job?jobName=demo&restoreMode=FULL&restoreSourceJobId=861119875632570369' --data @job.conf","handlingStrategy":"validation","validationCode":"const restoreMode = params.get(\"restoreMode\") || \"NONE\";\nconst restoring = restoreMode === \"FULL\" || restoreMode === \"LATE\";\nif (restoring && params.get(\"restoreSourceJobId\") == null) {\n  throw new Error(\"restoreMode=\" + restoreMode + \" requires restoreSourceJobId\");\n}","typeGuard":null,"tryCatchPattern":"try { submit(params); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"restoreSourceJobId is required\")) { /* fetch finished job id and resubmit */ } else throw e; }","preventionTips":["Record restoreSourceJobId together with restoreMode in your deployment scripts.","Distinguish jobId (new job) from restoreSourceJobId (state source) in tooling and docs.","Query the finished-jobs REST endpoint to resolve the source id before resubmitting."],"tags":["rest-api","restore","checkpoint","missing-parameter"],"backgroundTag":"missing-required-config-field","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"}