{"record":{"id":"4bda68495a37b5e9","repo":"apache/cassandra","slug":"sstable-format-name-in-s-cannot-be-null","errorCode":null,"errorMessage":"SSTable format name in %s cannot be null","messagePattern":"SSTable format name in (.+?) cannot be null","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1931,"sourceCode":"            else if (null != getCommitLogCompression())\n                with = \"compression\";\n            else\n                with = \"encryption\";\n            throw new ConfigurationException(\"commitlog_disk_access_mode = \" + accessModeDirectIoPair.left + \" is not supported with \" + with + \". Please use 'auto' when unsure.\", false);\n        }\n        else if (!compressOrEncrypt && accessModeDirectIoPair.left != DiskAccessMode.mmap && accessModeDirectIoPair.left != DiskAccessMode.direct)\n        {\n            throw new ConfigurationException(\"commitlog_disk_access_mode = \" + accessModeDirectIoPair.left + \" is not supported. Please use 'auto' when unsure.\", false);\n        }\n    }\n\n    private static void validateSSTableFormatFactories(Iterable<SSTableFormat.Factory> factories)\n    {\n        Map<String, SSTableFormat.Factory> factoryByName = new HashMap<>();\n        for (SSTableFormat.Factory factory : factories)\n        {\n            if (factory.name() == null)\n                throw new ConfigurationException(String.format(\"SSTable format name in %s cannot be null\", factory.getClass().getCanonicalName()));\n\n            if (!factory.name().matches(\"^[a-z]+$\"))\n                throw new ConfigurationException(String.format(\"SSTable format name for %s must be non-empty, lower-case letters only string\", factory.getClass().getCanonicalName()));\n\n            SSTableFormat.Factory prev = factoryByName.put(factory.name(), factory);\n            if (prev != null)\n                throw new ConfigurationException(String.format(\"Multiple sstable format implementations with the same name %s: %s and %s\", factory.name(), factory.getClass().getCanonicalName(), prev.getClass().getCanonicalName()));\n        }\n    }\n\n    private static ImmutableMap<String, Supplier<SSTableFormat<?, ?>>> validateAndMatchSSTableFormatOptions(Iterable<SSTableFormat.Factory> factories, Map<String, Map<String, String>> options)\n    {\n        ImmutableMap.Builder<String, Supplier<SSTableFormat<?, ?>>> providersBuilder = ImmutableMap.builder();\n        if (options == null)\n            options = ImmutableMap.of();\n        for (SSTableFormat.Factory factory : factories)\n        {\n            Map<String, String> formatOptions = options.getOrDefault(factory.name(), ImmutableMap.of());","sourceCodeStart":1913,"sourceCodeEnd":1949,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1913-L1949","documentation":"When registering SSTable format factories, DatabaseDescriptor.validateSSTableFormatFactories requires every factory to expose a non-null format name, since the name is the lookup key used by config (sstable.format) and manifest parsing. A factory returning null from name() is a programming/config error and aborts startup.","triggerScenarios":"A custom SSTableFormat.Factory on the classpath (loaded via the sstable format factory mechanism) returns null from name(); the loop over factories detects it and throws ConfigurationException naming the factory class.","commonSituations":"Developing a third-party SSTable format whose name() isn't implemented or returns null; a factory built reflectively from misconfigured parameters leaving the name field unset.","solutions":["Fix the custom factory implementation so name() returns a non-null identifier (e.g. \"btreeplus\"-style lowercase string)","If the factory comes from a third-party jar, upgrade to a version with a proper name() or remove the jar/lib entry","Check the class named in the message and set its format name field/config so name() is populated"],"exampleFix":"// before\npublic class MyFormatFactory implements SSTableFormat.Factory {\n    public String name() { return myNameField; } // null when unset\n}\n// after\npublic class MyFormatFactory implements SSTableFormat.Factory {\n    public String name() { return myNameField != null ? myNameField : \"myformat\"; }\n}","handlingStrategy":"validation","validationCode":"if (yaml.get(\"partitioner\") == null) throw new IllegalStateException(\"set partitioner before startup\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { /* inspect and fix yaml */ }","preventionTips":["Keep full default cassandra.yaml in templates"],"tags":["sstable","configuration","plugin"],"backgroundTag":"null-argument","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}