{"record":{"id":"bf473b3513d57469","repo":"apache/cassandra","slug":"unknown-version-version","errorCode":null,"errorMessage":"Unknown version: \" + version","messagePattern":"Unknown version: \" \\+ version","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/accord/serializers/Version.java","lineNumber":77,"sourceCode":"     * For the accord versioned serializers they sometimes need to access existing messaging serializers, in these cases an agreed messaging version is required and can not be plumbed directly from the messaging layer.\n     *\n     * @see #messageVersion()\n     */\n    private final MessagingService.Version messagingVersion;\n\n    Version(int version, MessagingService.Version messagingVersion)\n    {\n        this.version = version;\n        this.messagingVersion = messagingVersion;\n    }\n\n    public static Version fromVersion(int version)\n    {\n        switch (version)\n        {\n            case 1: return V1;\n            default:\n                throw new IllegalArgumentException(\"Unknown version: \" + version);\n        }\n    }\n\n    public static Version findBestMatchForMessagingVersion(int messagingVersion)\n    {\n        Version[] versions = values();\n        for (int i = versions.length - 1; i >= 0; i--)\n        {\n            Version v = versions[i];\n            // If network version bumped (12 to 13), the accord serializers may not have been changed; use the largest\n            // version smaller than or equal to this version\n            if (v.messageVersion() <= messagingVersion)\n                return v;\n        }\n        throw new IllegalArgumentException(\"Attempted to use message version \" + messagingVersion + \" which is smaller than \" + versions[0] + \" can handle (\" + versions[0].messageVersion() + \")\");\n    }\n\n    @Override","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/accord/serializers/Version.java#L59-L95","documentation":"Parses an integer wire version into the Version enum for Accord serializers. Only version 1 exists; any other integer has no corresponding enum constant, so the factory throws IllegalArgumentException rather than returning null. This guards the messaging layer against peers speaking an unknown Accord serialization dialect.","triggerScenarios":"Calling Version.fromVersion(int) with any value other than 1.","commonSituations":"Version skew during rolling upgrades where a newer node advertises an Accord version this build does not know; misconfigured test harnesses passing raw messaging versions instead of Accord versions.","solutions":["Upgrade the node so it recognizes the version being passed (align all nodes to the same Cassandra build).","Verify callers pass an Accord serialization version, not a messaging version.","Wrap the call and fail fast on version negotiation to prevent corrupted deserialization downstream."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (version != 1) throw new IllegalArgumentException(\"Unsupported Accord version: \" + version + \", only 1 is known to this build\");","typeGuard":null,"tryCatchPattern":"try {\n    Version v = Version.fromVersion(rawVersion);\n} catch (IllegalArgumentException e) {\n    logger.error(\"Peer sent unknown Accord version; refusing connection\", e);\n    return; // fail fast, do not attempt deserialization\n}","preventionTips":["Check version negotiation before exchanging Accord messages","Align builds across the cluster before enabling Accord","Never pass messaging versions where Accord versions are expected"],"tags":["versioning","accord","serialization"],"backgroundTag":"invalid-enum-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}