{"record":{"id":"272d02fec064cca6","repo":"apache/incubator-seata","slug":"unknown-globalstatus-code-272d02","errorCode":null,"errorMessage":"Unknown GlobalStatus[{code}]","messagePattern":"Unknown GlobalStatus\\[(.+?)\\]","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compatible/src/main/java/io/seata/core/model/GlobalStatus.java","lineNumber":172,"sourceCode":"     * @param code the code\n     * @return the global status\n     */\n    public static GlobalStatus get(byte code) {\n        return get((int) code);\n    }\n\n    /**\n     * Get global status.\n     *\n     * @param code the code\n     * @return the global status\n     */\n    public static GlobalStatus get(int code) {\n        GlobalStatus value = null;\n        try {\n            value = GlobalStatus.values()[code];\n        } catch (Exception e) {\n            throw new IllegalArgumentException(\"Unknown GlobalStatus[\" + code + \"]\");\n        }\n        return value;\n    }\n\n    /**\n     * Is one phase timeout boolean.\n     *\n     * @param status the status\n     * @return the boolean\n     */\n    public static boolean isOnePhaseTimeout(GlobalStatus status) {\n        if (status == TimeoutRollbacking\n                || status == TimeoutRollbackRetrying\n                || status == TimeoutRollbacked\n                || status == TimeoutRollbackFailed) {\n            return true;\n        }\n        return false;","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/compatible/src/main/java/io/seata/core/model/GlobalStatus.java#L154-L190","documentation":"Compatible-layer (io.seata) mirror of GlobalStatus.get: it indexes the enum by code and throws IllegalArgumentException for out-of-range values. Used when legacy io.seata code converts stored or wire-format status integers into the typed enum.","triggerScenarios":"Calling io.seata.core.model.GlobalStatus.get(code) with a negative code or one beyond the last ordinal — during unwrap/conversion of status data produced by a peer running a different Seata version, or with corrupted stored data.","commonSituations":"io.seata compatible artifacts combined with org.apache.seata components of a different release (added GlobalStatus constants); deserializing old persisted transaction state; garbage ints from malformed messages.","solutions":["Use one consistent Seata version for all compatible and core artifacts.","Log the failing code and compare against io.seata GlobalStatus values on both producer and consumer.","Migrate fully to org.apache.seata APIs to avoid the double enum conversion.","Bounds-check the code before calling get()."],"exampleFix":"// before\nio.seata.core.model.GlobalStatus s = io.seata.core.model.GlobalStatus.get(code);\n\n// after\nio.seata.core.model.GlobalStatus[] all = io.seata.core.model.GlobalStatus.values();\nif (code < 0 || code >= all.length) {\n    throw new IllegalStateException(\"status code \" + code + \" not known by this build; version skew?\");\n}\nio.seata.core.model.GlobalStatus s = all[code];","handlingStrategy":"validation","validationCode":"boolean isKnownGlobalStatus(int code) {\n    io.seata.core.model.GlobalStatus[] all = io.seata.core.model.GlobalStatus.values();\n    return code >= 0 && code < all.length;\n}","typeGuard":null,"tryCatchPattern":"try {\n    return io.seata.core.model.GlobalStatus.get(code);\n} catch (IllegalArgumentException e) {\n    LOGGER.error(\"status code {} unknown to compatible build — version skew\", code);\n    throw e;\n}","preventionTips":["Run one Seata release train across core and compatible artifacts.","Migrate new code to org.apache.seata.saga/model APIs to avoid double conversion.","Bounds-check persisted status ints before enum mapping."],"tags":["enum","compatibility","version-mismatch","global-status"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}