{"record":{"id":"7a73e05249c15730","repo":"apache/cassandra","slug":"compressor-providers-entry-is-missing-required-cl","errorCode":null,"errorMessage":"compressor_providers entry is missing required 'class_name': %s","messagePattern":"compressor_providers entry is missing required 'class_name': (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/io/compress/CompressorRegistry.java","lineNumber":273,"sourceCode":"        if (parameterizedClass == null)\n            parameterizedClass = providerOptions.get(type.abbreviation);\n\n        return parameterizedClass;\n    }\n\n    /**\n     * Returns a compression provider with configuration specified in the config file.\n     * If the provider fails to initialize or is not healthy, will attempt to fall back to the default provider\n     * if enabled in the configuration.\n     *\n     * @param providerConfig the configuration for the provider\n     * @return the compression provider instance\n     * @throws ConfigurationException if both the specified and fallback providers fail to initialize\n     */\n    AbstractCompressionProvider resolveProvider(ParameterizedClass providerConfig)\n    {\n        if (providerConfig.class_name == null)\n            throw new ConfigurationException(\"compressor_providers entry is missing required 'class_name': \" + providerConfig);\n\n        Map<String, String> p = providerConfig.parameters == null ? Collections.emptyMap() : providerConfig.parameters;\n\n        try\n        {\n            AbstractCompressionProvider compressionProvider = FBUtilities.newCompressionProvider(providerConfig.class_name);\n            compressionProvider.init(new HashMap<>(p));\n\n            if (compressionProvider.isHealthy())\n            {\n                return compressionProvider;\n            }\n            else\n            {\n                logger.warn(\"Compression provider {} is not healthy, attempting fallback.\", providerConfig.class_name);\n            }\n        }\n        catch (Throwable e)","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/compress/CompressorRegistry.java#L255-L291","documentation":"Each compressor_providers entry is a ParameterizedClass that must name the provider implementation via its class_name field. resolveProvider() throws ConfigurationException when class_name is null because there is nothing to instantiate. Without class_name Cassandra cannot know which AbstractCompressionProvider to construct for the given compressor key.","triggerScenarios":"registerProviders() resolving a provider config whose ParameterizedClass.class_name is null — e.g. a YAML entry like 'LZ4:' with an empty value, or a programmatically constructed ParameterizedClass without class_name set.","commonSituations":"YAML map entries where the value is omitted or left blank; refactoring code that builds ParameterizedClass objects and forgets to set class_name; copying config examples that use a different field name.","solutions":["Add the class_name field to the compressor_providers entry, e.g. 'LZ4: { class_name: com.example.MyCompressionProvider }'.","If you meant to use the built-in implementation, remove the entry entirely — absence of a provider falls back to DefaultCompressionProvider.","Validate that the config parser maps your YAML key to the expected class_name field (ParameterizedClass expects class_name, not class or className)."],"exampleFix":"// before\ncassandra.yaml: compressor_providers: { LZ4: { } }\n// after\ncassandra.yaml: compressor_providers: { LZ4: { class_name: com.example.MyCompressionProvider } }","handlingStrategy":"validation","validationCode":"if (cfg.compressorProviders != null)\n    for (Map.Entry<String, ParameterizedClass> e : cfg.compressorProviders.entrySet())\n        if (e.getValue() == null || e.getValue().class_name == null)\n            throw new IllegalArgumentException(\"compressor_providers entry for '\" + e.getKey() + \"' missing class_name\");","typeGuard":"boolean hasClassName(ParameterizedClass pc) { return pc != null && pc.class_name != null && !pc.class_name.trim().isEmpty(); }","tryCatchPattern":"try {\n    registry.registerProviders(providers);\n} catch (ConfigurationException e) {\n    if (e.getMessage().contains(\"missing required 'class_name'\")) log.error(\"Add class_name to compressor_providers entry\");\n    throw e;\n}","preventionTips":["Always specify class_name for every compressor_providers entry","Remove entries entirely (instead of leaving them empty) to use the default provider","Remember the field name is class_name (snake_case), not className","Validate cassandra.yaml structurally before startup"],"tags":["configuration","compression","missing-field"],"backgroundTag":"missing-required-config-field","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"}