apache/cassandra · critical · RuntimeException

Cannot find configured row cache provider class ${DatabaseDe

Error message

Cannot find configured row cache provider class ${DatabaseDescriptor.getRowCacheClassName()}

What it means

CacheService.initRowCache reflectively instantiates the configured row cache provider class (DatabaseDescriptor.getRowCacheClassName()). If instantiation fails for any reason (class missing, wrong type, constructor exception), it throws RuntimeException naming the configured class, swallowing the underlying cause.

Source

Thrown at src/java/org/apache/cassandra/service/CacheService.java:158

     */
    private AutoSavingCache<RowCacheKey, IRowCacheEntry> initRowCache()
    {
        logger.info("Initializing row cache with capacity of {} MiBs", DatabaseDescriptor.getRowCacheSizeInMiB());

        CacheProvider<RowCacheKey, IRowCacheEntry> cacheProvider;
        String cacheProviderClassName = DatabaseDescriptor.getRowCacheSizeInMiB() > 0
                                        ? DatabaseDescriptor.getRowCacheClassName() : "org.apache.cassandra.cache.NopCacheProvider";
        try
        {
            Class<? extends CacheProvider> cacheProviderClass =
                FBUtilities.classForNameWithoutInitialization(cacheProviderClassName, "row cache provider", CacheProvider.class);
            @SuppressWarnings("unchecked")
            CacheProvider<RowCacheKey, IRowCacheEntry> typedCacheProvider = cacheProviderClass.newInstance();
            cacheProvider = typedCacheProvider;
        }
        catch (Exception e)
        {
            throw new RuntimeException("Cannot find configured row cache provider class " + DatabaseDescriptor.getRowCacheClassName());
        }

        // cache object
        ICache<RowCacheKey, IRowCacheEntry> rc = cacheProvider.create();
        AutoSavingCache<RowCacheKey, IRowCacheEntry> rowCache = new AutoSavingCache<>(rc, CacheType.ROW_CACHE, new RowCacheSerializer());

        int rowCacheKeysToSave = DatabaseDescriptor.getRowCacheKeysToSave();

        rowCache.scheduleSaving(DatabaseDescriptor.getRowCacheSavePeriod(), rowCacheKeysToSave);

        return rowCache;
    }

    private AutoSavingCache<CounterCacheKey, ClockAndCount> initCounterCache()
    {
        logger.info("Initializing counter cache with capacity of {} MiBs", DatabaseDescriptor.getCounterCacheSizeInMiB());

        long capacity = DatabaseDescriptor.getCounterCacheSizeInMiB() * 1024 * 1024;

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Correct row_cache_class_in in cassandra.yaml or remove it to use the default provider
  2. Ensure the provider class JAR is on the classpath of every node
  3. Verify the class implements CacheProvider<RowCacheKey, IRowCacheEntry> and has a public no-arg constructor
  4. Check server logs for the suppressed cause of the newInstance() failure

Example fix

// cassandra.yaml
// before
row_cache_class_in: org.example.MyCacheProvider
// after
row_cache_class_in: org.apache.cassandra.cache.OHCProvider
Defensive patterns

Strategy: try-catch

Validate before calling

String cls = DatabaseDescriptor.getRowCacheClassName();
try { Class.forName(cls); }
catch (ClassNotFoundException e) { throw new IllegalStateException("Row cache provider not on classpath: " + cls); }

Try / catch

try { cacheService.initRowCache(); } catch (RuntimeException e) { if (e.getMessage().startsWith("Cannot find configured row cache provider")) { /* revert to default OHCProvider and rethrow with cause */ } throw e; }

Prevention

When it happens

Trigger: Node startup with row_cache_class_in (or equivalent) set to a class that is not on the classpath, does not implement CacheProvider<RowCacheKey, IRowCacheEntry>, or fails in its no-arg constructor/newInstance.

Common situations: Typos in the fully-qualified class name in cassandra.yaml; custom cache provider JAR not shipped with the node; provider compiled against an incompatible Cassandra version.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/9fd45d0d539d1713. Report an issue: GitHub.