{"record":{"id":"de5876cf0706b36a","repo":"apache/cassandra","slug":"attempted-to-use-message-version-messagingvers","errorCode":null,"errorMessage":"Attempted to use message version \" + messagingVersion + \" which is smaller than \" + versions[0] + \" can handle (\" + versions[0].messageVersion() + \")","messagePattern":"Attempted to use message version \" \\+ messagingVersion \\+ \" which is smaller than \" \\+ versions\\[0\\] \\+ \" can handle \\(\" \\+ versions\\[0\\]\\.messageVersion\\(\\) \\+ \"\\)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/accord/serializers/Version.java","lineNumber":92,"sourceCode":"        {\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\n    public int messageVersion()\n    {\n        return messagingVersion.value;\n    }\n\n    public List<Version> greaterThanOrEqual()\n    {\n        Version[] all = Version.values();\n        if (ordinal() == all.length - 1)\n            return Collections.singletonList(this);\n        List<Version> values = new ArrayList<>(all.length - ordinal());\n        for (int i = ordinal(); i < all.length; i++)\n            values.add(all[i]);\n        return values;\n    }","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/accord/serializers/Version.java#L74-L110","documentation":"Maps a cluster messaging version to the best supported Accord serializer Version. Because the enum only supports versions whose messageVersion is >= versions[0], a messaging version below the minimum cannot be negotiated and the method throws IllegalArgumentException. The scan relies on versions being ordered ascending, returning the first Version whose messageVersion is <= the requested one.","triggerScenarios":"Calling Version.findBestMatchForMessagingVersion(messagingVersion) with a value smaller than the lowest supported Accord messaging version.","commonSituations":"A pre-upgrade node (older messaging version) attempting to exchange Accord messages with fully upgraded nodes; cluster with mixed Cassandra versions where Accord is enabled but the old node's messaging version is too low.","solutions":["Complete the rolling upgrade so all nodes meet the minimum messaging version required by Accord.","Disable Accord on nodes below the minimum messaging version.","Check the versions array ordering/support floor if modifying the enum, and document the minimum messaging version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (messagingVersion < Version.values()[0].messageVersion())\n    throw new IllegalStateException(\"messagingVersion \" + messagingVersion + \" below Accord minimum \" + Version.values()[0].messageVersion());","typeGuard":null,"tryCatchPattern":"try {\n    Version v = Version.findBestMatchForMessagingVersion(messagingVersion);\n} catch (IllegalArgumentException e) {\n    logger.error(\"Messaging version too low for Accord; upgrade peer\", e);\n    disableAccordForPeer();\n}","preventionTips":["Verify minimum messaging version requirements before rolling upgrades","Gate Accord features on all nodes meeting the version floor","Test mixed-version clusters before production upgrades"],"tags":["versioning","accord","compatibility"],"backgroundTag":"invalid-argument-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"}