{"record":{"id":"33ebec057ea6cff6","repo":"apache/incubator-seata","slug":"cannot-convert-name-33ebec","errorCode":null,"errorMessage":"Cannot convert {name}","messagePattern":"Cannot convert (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compatible/src/main/java/io/seata/saga/statelang/domain/StateType.java","lineNumber":114,"sourceCode":"                return SERVICE_TASK;\n            case CHOICE:\n                return CHOICE;\n            case FAIL:\n                return FAIL;\n            case SUCCEED:\n                return SUCCEED;\n            case COMPENSATION_TRIGGER:\n                return COMPENSATION_TRIGGER;\n            case SUB_STATE_MACHINE:\n                return SUB_STATE_MACHINE;\n            case SUB_MACHINE_COMPENSATION:\n                return SUB_MACHINE_COMPENSATION;\n            case SCRIPT_TASK:\n                return SCRIPT_TASK;\n            case LOOP_START:\n                return LOOP_START;\n            default:\n                throw new IllegalArgumentException(\"Cannot convert \" + target.name());\n        }\n    }\n\n    public org.apache.seata.saga.statelang.domain.StateType unwrap() {\n        switch (this) {\n            case SERVICE_TASK:\n                return org.apache.seata.saga.statelang.domain.StateType.SERVICE_TASK;\n            case CHOICE:\n                return org.apache.seata.saga.statelang.domain.StateType.CHOICE;\n            case FAIL:\n                return org.apache.seata.saga.statelang.domain.StateType.FAIL;\n            case SUCCEED:\n                return org.apache.seata.saga.statelang.domain.StateType.SUCCEED;\n            case COMPENSATION_TRIGGER:\n                return org.apache.seata.saga.statelang.domain.StateType.COMPENSATION_TRIGGER;\n            case SUB_STATE_MACHINE:\n                return org.apache.seata.saga.statelang.domain.StateType.SUB_STATE_MACHINE;\n            case SUB_MACHINE_COMPENSATION:","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/compatible/src/main/java/io/seata/saga/statelang/domain/StateType.java#L96-L132","documentation":"Thrown by StateType.wrap(org.apache.seata...StateType) when converting an Apache Seata StateType to the io.seata compatibility enum and the default branch is reached. The switch maps all standard types (SERVICE_TASK through LOOP_START); hitting default means the runtime org.apache.seata enum contains a constant the compatible layer predates — a Seata version mismatch or a fork extension.","triggerScenarios":"Calling StateType.wrap(target) — usually indirectly when the compatible adapter reads a state machine parsed by the org.apache.seata engine — with an org.apache.seata StateType constant not covered by the compatible jar (e.g. a new state type introduced in a newer Apache Seata release).","commonSituations":"Upgrading org.apache.seata core to take advantage of a new state type while the io.seata compatibility (or a third-party SDK built on it) stays on the old release; using a vendor fork with extra state types.","solutions":["Upgrade the io.seata compatibility dependency to the release matching your org.apache.seata core so both StateType enums define the same constants.","Stop using the newly introduced state type until all layers understand it, or drop back to the older core version.","Enforce a single Seata version via BOM/dependencyManagement to keep the paired jars in lockstep."],"exampleFix":"// before\n <properties>\n   <seata.version>2.0.0</seata.version>        <!-- compatible layer -->\n   <seata.apache.version>2.2.0</seata.apache.version> <!-- core -->\n </properties>\n\n// after\n <properties>\n   <seata.version>2.2.0</seata.version>\n   <seata.apache.version>2.2.0</seata.apache.version>\n </properties>","handlingStrategy":"validation","validationCode":"Set<String> known = Arrays.stream(StateType.values())\n    .map(StateType::name).collect(Collectors.toSet());\n\nif (target != null && !known.contains(target.name())) {\n    throw new IllegalStateException(\"Apache StateType '\" + target\n        + \"' predates the installed io.seata compatible layer; upgrade it\");\n}\nreturn StateType.wrap(target);","typeGuard":null,"tryCatchPattern":"try {\n    return StateType.wrap(target);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"StateType '\" + target + \"' unmappable; align Seata versions\", e);\n}","preventionTips":["Upgrade the compatibility dependency whenever you upgrade the Apache Seata core.","Avoid adopting brand-new state types until every adapter in your stack supports them.","Run saga integration tests in CI against the exact version matrix you deploy."],"tags":["saga","enum","compatibility","version-mismatch","state-machine"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}