{"record":{"id":"b270bf10dd64cbb0","repo":"aeron-io/aeron","slug":"no-clustereventcode-for-id-id","errorCode":null,"errorMessage":"no ClusterEventCode for id: <id>","messagePattern":"no ClusterEventCode for id: <id>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-cluster/src/main/java/io/aeron/cluster/logging/ClusterEventCode.java","lineNumber":208,"sourceCode":"            EVENT_CODE_BY_ID[id] = code;\n        }\n    }\n\n    ClusterEventCode(final int id)\n    {\n        this.id = id;\n    }\n\n    /**\n     * Get the ClusterEventCode enum value from the identifier.\n     * @param id to look up.\n     * @return the resolved enum value.\n     */\n    public static ClusterEventCode get(final int id)\n    {\n        if (id < 0 || id >= EVENT_CODE_BY_ID.length)\n        {\n            throw new IllegalArgumentException(\"no ClusterEventCode for id: \" + id);\n        }\n\n        final ClusterEventCode code = EVENT_CODE_BY_ID[id];\n        if (null == code)\n        {\n            throw new IllegalArgumentException(\"no ClusterEventCode for id: \" + id);\n        }\n\n        return code;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    @Override\n    public int id()\n    {\n        return id;","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-cluster/src/main/java/io/aeron/cluster/logging/ClusterEventCode.java#L190-L226","documentation":"ClusterEventCode.get(int id) resolves a numeric event code to the enum; the id is outside the valid table range (negative or >= EVENT_CODE_BY_ID.length), so IllegalArgumentException is thrown. Raised from fromEventCodeId when decoding an event with an unrecognized id.","triggerScenarios":"Calling ClusterEventCode.fromEventCodeId (or get) with an id not present in this build's enum table, e.g. an id from a newer Aeron cluster version.","commonSituations":"Client on older aeron-cluster decoding event codes emitted by a newer cluster; log-analysis tools reading corrupted or foreign event logs.","solutions":["Upgrade the aeron-cluster dependency so the enum contains the new event code","Validate the event code id against ClusterEventCode values before calling get/fromEventCodeId","Handle unknown ids defensively: catch IllegalArgumentException and fall back to logging the raw id","If the id comes from a log file, confirm it was produced by a compatible Aeron version"],"exampleFix":"// before\nClusterEventCode code = ClusterEventCode.fromEventCodeId(id);\n// after\nClusterEventCode code = (id >= 0 && id < ClusterEventCode.values().length)\n    ? ClusterEventCode.fromEventCodeId(id)\n    : null; // handle unknown code","handlingStrategy":"type-guard","validationCode":"boolean isValid = id >= 0 && id < ClusterEventCode.values().length;","typeGuard":"boolean isKnownEventCode(int id) {\n    return id >= 0 && id < ClusterEventCode.values().length\n        && ClusterEventCode.get(id) != null; // guarded by try-catch in practice\n}","tryCatchPattern":"try {\n    ClusterEventCode code = ClusterEventCode.fromEventCodeId(id);\n} catch (IllegalArgumentException ex) {\n    // unknown event code: log raw id\n}","preventionTips":["Upgrade aeron-cluster when consuming event logs from newer clusters","Validate ids before resolution in log tooling","Never hardcode event code ids from other versions"],"tags":["aeron","enum","event-log"],"backgroundTag":"invalid-enum-value","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}