apache/cassandra · critical · IllegalArgumentException
Unknown commitlog service type: <commitLogSync>
Error message
Unknown commitlog service type: <commitLogSync>
What it means
CommitLog's constructor creates a CommitLogExecutorService based on the configured commitlog_sync mode (periodic, batch, group). If DatabaseDescriptor.getCommitLogSync() returns a value with no matching case, it throws IllegalArgumentException "Unknown commitlog service type". This guards against unhandled enum values, e.g. from a newer config parsed by an older binary.
Source
Thrown at src/java/org/apache/cassandra/db/commitlog/CommitLog.java:129
DatabaseDescriptor.getCommitLogWriteDiskAccessMode());
DatabaseDescriptor.createAllDirectories();
this.archiver = archiver;
metrics = new CommitLogMetrics();
switch (DatabaseDescriptor.getCommitLogSync())
{
case periodic:
executor = new PeriodicCommitLogService(this);
break;
case batch:
executor = new BatchCommitLogService(this);
break;
case group:
executor = new GroupCommitLogService(this);
break;
default:
throw new IllegalArgumentException("Unknown commitlog service type: " + DatabaseDescriptor.getCommitLogSync());
}
segmentManager = segmentManagerProvider.apply(this);
// register metrics
metrics.attach(executor, segmentManager);
}
/**
* Tries to start the CommitLog if not already started.
*/
synchronized public CommitLog start()
{
if (started)
return this;
try
{View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Set commitlog_sync in cassandra.yaml to one of: periodic, batch, or group (matching your Cassandra version's supported values)
- Check the exact spelling/case of the value; compare against Config.CommitLogSync in your binary's version
- Remove config values inherited from a newer Cassandra version if you downgraded, or upgrade the binary instead
- Validate config with the target version's documentation before deployment
Example fix
// before (cassandra.yaml) commitlog_sync: twync // after commitlog_sync: periodic
Defensive patterns
Strategy: validation
Validate before calling
Set<String> valid = Set.of("periodic", "batch", "group");
String mode = yaml.get("commitlog_sync");
if (!valid.contains(mode)) throw new IllegalArgumentException("Unsupported commitlog_sync: " + mode); Type guard
null
Try / catch
try { startCassandra(); } catch (IllegalArgumentException e) { if (e.getMessage().contains("Unknown commitlog service type")) { /* correct commitlog_sync value and restart */ } else throw e; } Prevention
- Validate commitlog_sync against the running binary's supported enum before upgrade/downgrade
- Keep cassandra.yaml in sync with the Cassandra version (downgrades especially)
- Use schema/JSON validation on generated configs in automation
When it happens
Trigger: Setting an invalid or unsupported commitlog_sync value in cassandra.yaml, or a config from a newer Cassandra version whose new sync mode is not understood by the running binary.
Common situations: Typo like commitlog_sync: Periodic (case-sensitive enum parse) or an unknown mode name; rolling back a version downgrade where the new mode persisted in config is unsupported; hand-edited yaml with an invented value.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- commitlog_directory must be specified
- Commit log flush interval must be positive: %fms
- Unable to parse precision of value
- %s has authorization enabled which requires %s to enable aut
- %s requires %s
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/2b5344208c3f2312.
Report an issue: GitHub.