{"record":{"id":"c3583a0e37d08bdf","repo":"apache/cassandra","slug":"invalid-partitioner-class","errorCode":null,"errorMessage":"Invalid partitioner class ","messagePattern":"Invalid partitioner class ","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1847,"sourceCode":"        applyPartitioner(conf);\n    }\n\n    public static void applyPartitioner(Config conf)\n    {\n        /* Hashing strategy */\n        if (conf.partitioner == null)\n        {\n            throw new ConfigurationException(\"Missing directive: partitioner\", false);\n        }\n        String name = conf.partitioner;\n        try\n        {\n            name = PARTITIONER.getString(conf.partitioner);\n            partitioner = FBUtilities.newPartitioner(name);\n        }\n        catch (Exception e)\n        {\n            throw new ConfigurationException(\"Invalid partitioner class \" + name, e);\n        }\n\n        partitionerName = partitioner.getClass().getCanonicalName();\n    }\n\n    private static Pair<DiskAccessMode, Boolean> resolveCommitLogWriteDiskAccessMode(DiskAccessMode providedDiskAccessMode)\n    {\n        boolean compressOrEncrypt = getCommitLogCompression() != null || (getEncryptionContext() != null && getEncryptionContext().isEnabled());\n        boolean directIOSupported = false;\n        // File.getBlockSize creates directories/files tools may not have permissions for\n        if (!toolInitialized)\n        {\n            try\n            {\n                String commitLogLocation = getCommitLogLocation();\n\n                if (commitLogLocation == null)\n                    throw new ConfigurationException(\"commitlog_directory must be specified\", false);","sourceCodeStart":1829,"sourceCodeEnd":1865,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1829-L1865","documentation":"After reading the partitioner name from the config, applyPartitioner() calls FBUtilities.newPartitioner(name) to load and instantiate the class. Any failure — unknown name, class not on the classpath, or a class that is not an IPartitioner — is wrapped and rethrown as 'Invalid partitioner class <name>'.","triggerScenarios":"partitioner in cassandra.yaml names a class that cannot be instantiated: typo (e.g. 'Murmur3Partitioner' without package), third-party partitioner jar absent, or the class does not implement IPartitioner; the catch around FBUtilities.newPartitioner throws ConfigurationException with the offending name appended.","commonSituations":"Typos or missing fully-qualified class name in cassandra.yaml; custom partitioner jar not shipped in lib/; using a partitioner removed or repackaged in a newer Cassandra version.","solutions":["Set the fully-qualified class name: partitioner: org.apache.cassandra.dht.Murmur3Partitioner","If using a custom partitioner, verify its jar is in lib/ and the class implements org.apache.cassandra.dht.IPartitioner","Check the wrapped cause exception in the log for ClassNotFoundException vs ClassCastException vs instantiation errors to pinpoint the problem","Never change the partitioner on an existing cluster with data — restore the original value and consult migration docs instead"],"exampleFix":"# before (cassandra.yaml)\npartitioner: Murmur3Partitioner\n# after\npartitioner: org.apache.cassandra.dht.Murmur3Partitioner","handlingStrategy":"validation","validationCode":"Class.forName(partitionerName);","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.applyPartitioner(conf); } catch (ConfigurationException e) { /* fix class */ }","preventionTips":["Verify partitioner class exists on classpath"],"tags":["configuration","partitioner","classpath"],"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-14T11:17:12.474Z"}