{"record":{"id":"1d4d41f6f16c6f8f","repo":"apache/seatunnel","slug":"unknown-job-state-jobstatus","errorCode":null,"errorMessage":"Unknown Job State: ${jobStatus}","messagePattern":"Unknown Job State: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalPlan.java","lineNumber":418,"sourceCode":"                updateJobState(JobStatus.RUNNING);\n                break;\n            case RUNNING:\n            case DOING_SAVEPOINT:\n                break;\n            case FAILING:\n            case CANCELING:\n                jobMaster.neverNeedRestore();\n                getPipelineList().forEach(SubPlan::cancelPipeline);\n                break;\n            case FAILED:\n            case CANCELED:\n            case SAVEPOINT_DONE:\n            case FINISHED:\n                stopJobStateProcess();\n                jobEndFuture.complete(new JobResult(jobStatus, errorBySubPlan.get()));\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unknown Job State: \" + jobStatus);\n        }\n    }\n\n    private void reportJobStateEvent(JobStatus jobStatus) {\n        try {\n            if (jobStatus.isEndState()\n                    || (this.engineConfig != null\n                            && this.engineConfig.isReportNonTerminalJobState())) {\n                jobMaster\n                        .getCoordinatorService()\n                        .getEventProcessor()\n                        .process(\n                                new JobStateEvent(\n                                        jobId,\n                                        jobImmutableInformation.getJobConfig().getName(),\n                                        jobStatus));\n            }\n        } catch (Exception e) {","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalPlan.java#L400-L436","documentation":"PhysicalPlan.stateProcess handles job states with an exhaustive switch; if jobStatus holds a value with no dedicated case, this IllegalArgumentException is thrown. In practice it means the state machine encountered a state the process loop does not know how to handle, indicating an engine-level inconsistency or an enum added without updating the handler.","triggerScenarios":"updateJobState transitions the plan into a state that stateProcess's switch does not cover; startJob kicks off state processing while the plan state is unexpected; a newly added JobStatus constant missing from the switch statement.","commonSituations":"Running a SeaTunnel version where a new JobStatus enum value was added but internal handling was not fully updated; corrupted IMap state storing an unexpected value; mixing engine server and client JARs of different versions.","solutions":["Upgrade engine server and clients to matching, latest patch versions","Inspect runningJobStateIMap for the offending job and its stored state value","Ensure the switch in stateProcess covers every JobStatus constant when extending the engine","Report/patch the engine bug if a supported enum value falls through to default"],"exampleFix":"// before\ncase FINISHED:\n    stopJobStateProcess();\n    break;\n// after\ncase FINISHED:\ncase CANCELED:\ncase FAILED:\n    stopJobStateProcess();\n    break;","handlingStrategy":"try-catch","validationCode":"// ensure engine jars are consistent\nSet<String> statuses = Arrays.stream(JobStatus.values()).map(Enum::name).collect(Collectors.toSet());\nif (!statuses.contains(jobStatusName)) throw new IllegalStateException(\"mismatched engine versions\");","typeGuard":"boolean knownStatus(JobStatus s) { return s != null && Arrays.asList(JobStatus.values()).contains(s); }","tryCatchPattern":"try { startJob(); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unknown Job State\")) { log.error(\"engine state corruption/version mismatch\", e); } else { throw e; } }","preventionTips":["Keep all engine modules on the same version","When extending JobStatus, update every switch","Monitor IMap state for corruption"],"tags":["zeta-engine","job-state","switch-default","state-machine"],"backgroundTag":"unsupported-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"}