{"record":{"id":"202c10501c872725","repo":"apache/incubator-seata","slug":"unknown-clienttype-ordinal","errorCode":null,"errorMessage":"Unknown ClientType[{ordinal}]","messagePattern":"Unknown ClientType\\[(.+?)\\]","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/seata/core/rpc/ClientType.java","lineNumber":60,"sourceCode":"     * @return the client type\n     */\n    public static ClientType get(byte ordinal) {\n        return get((int) ordinal);\n    }\n\n    /**\n     * Get client type.\n     *\n     * @param ordinal the ordinal\n     * @return the client type\n     */\n    public static ClientType get(int ordinal) {\n        for (ClientType clientType : ClientType.values()) {\n            if (clientType.ordinal() == ordinal) {\n                return clientType;\n            }\n        }\n        throw new IllegalArgumentException(\"Unknown ClientType[\" + ordinal + \"]\");\n    }\n}\n","sourceCodeStart":42,"sourceCodeEnd":63,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/core/src/main/java/org/apache/seata/core/rpc/ClientType.java#L42-L63","documentation":"ClientType.get(int) maps a numeric client type from the protocol to the ClientType enum (TM, RM). It throws when the ordinal is outside the enum range — the decoded byte cannot identify a client type on this build.","triggerScenarios":"Decoding register/heartbeat messages whose client-type field is out of range: version skew with an extended enum on the peer, or a corrupted frame where the type byte is garbage.","commonSituations":"Mixed client/server Seata versions during rolling upgrade, foreign protocols hitting the TC port, or stream corruption from a misconfigured proxy.","solutions":["Align Seata versions across TM/RM/TC.","Ensure direct TCP connectivity; keep binary Seata traffic away from L7 proxies.","Turn on remoting debug logs and inspect the offending message id/type to confirm skew vs corruption."],"exampleFix":"# before\nseata client 1.5 registering with tc 2.2\n# after\nseata client 2.2 registering with tc 2.2","handlingStrategy":"type-guard","validationCode":"static boolean validClientType(int o) {\n    for (ClientType c : ClientType.values()) if (c.ordinal() == o) return true;\n    return false;\n}","typeGuard":"static Optional<ClientType> safeClientType(int o) {\n    return Arrays.stream(ClientType.values()).filter(c -> c.ordinal() == o).findFirst();\n}","tryCatchPattern":"catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unknown ClientType\")) { rejectConnectionAndLog(); }\n    else throw e;\n}","preventionTips":["Same-version deployments; restrict TC port to Seata clients only"],"tags":["protocol","enum","decode","version-mismatch"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}