{"record":{"id":"090632269ff1c88c","repo":"apache/cassandra","slug":"unsupported-metadata-version-s","errorCode":null,"errorMessage":"Unsupported metadata version (%s)","messagePattern":"Unsupported metadata version \\((.+?)\\)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/tcm/serialization/Version.java","lineNumber":161,"sourceCode":"    }\n\n    public boolean isBefore(Version other)\n    {\n        return version < other.version;\n    }\n\n    public boolean isAfter(Version other)\n    {\n        return version > other.version;\n    }\n\n    public static Version fromInt(int i)\n    {\n        Version v = values.get(i);\n        if (v != null)\n            return v;\n\n        throw new IllegalArgumentException(\"Unsupported metadata version (\" + i + \")\");\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    }\n}\n","sourceCodeStart":143,"sourceCodeEnd":175,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/serialization/Version.java#L143-L175","documentation":"Version.fromInt converts a serialized integer metadata version into the Version enum. If the integer does not correspond to any known version (values map lookup misses), it throws IllegalArgumentException. This typically means the data was produced by an incompatible Cassandra/TCM version - either too new (unknown higher version) or corrupt.","triggerScenarios":"Deserializing ClusterMetadata persisted/replicated by a newer or older incompatible Cassandra version; corrupted metadata snapshot/commit log containing a bogus version int.","commonSituations":"Downgrade attempted after metadata version bumped; mixing node versions in a cluster beyond supported compatibility; disk corruption of TCM persistence.","solutions":["Ensure all cluster nodes run a version whose metadata version is known to this build - align versions","If downgrade caused it, restore metadata from a backup taken at the older version or wipe and re-bootstrap from seed data","If data is corrupt, restore the TCM persistence files from snapshot/backup"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// validate the metadata version int before deserializing\nif (!knownVersions.contains(versionInt))\n    throw new IllegalArgumentException(\"Unsupported metadata version: \" + versionInt);","typeGuard":null,"tryCatchPattern":"try { Version v = Version.fromInt(i); }\ncatch (IllegalArgumentException e) {\n    // data from incompatible cluster version - refuse to load, alert operator\n}","preventionTips":["Never downgrade a cluster below the version that wrote its TCM metadata","Keep all nodes on versions with compatible metadata versions","Back up TCM persistence before upgrades so corrupt/mismatched data can be restored"],"tags":["serialization","version-compatibility","tcm"],"backgroundTag":"unsupported-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"}