apache/cassandra · error · IllegalArgumentException
Invalid pair: '%s'
Error message
Invalid pair: '%s'
What it means
CommitLogReplayer.create parses the cassandra.commitlog_replay_list property (replayList) into a keyspace/table multimap. Each comma-separated entry is trimmed; if an entry is empty or ends with a dot (implying a missing table), an IllegalArgumentException 'Invalid pair: <entry>' is thrown before replay begins.
Source
Thrown at src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java:406
/**
* Creates filter for entities to replay mutations for upon commit log replay.
*
* @see org.apache.cassandra.config.CassandraRelevantProperties#COMMIT_LOG_REPLAY_LIST
* */
public static ReplayFilter create()
{
String replayList = COMMIT_LOG_REPLAY_LIST.getString();
if (replayList == null)
return new AlwaysReplayFilter();
Multimap<String, String> toReplay = HashMultimap.create();
for (String rawPair : replayList.split(","))
{
String trimmedRawPair = rawPair.trim();
if (trimmedRawPair.isEmpty() || trimmedRawPair.endsWith("."))
throw new IllegalArgumentException(format("Invalid pair: '%s'", trimmedRawPair));
String[] pair = StringUtils.split(trimmedRawPair, '.');
if (pair.length > 2)
throw new IllegalArgumentException(format("%s property contains an item which " +
"is not in format 'keyspace' or 'keyspace.table' " +
"but it is '%s'",
COMMIT_LOG_REPLAY_LIST.getKey(),
String.join(".", pair)));
String keyspaceName = pair[0];
Keyspace ks = Schema.instance.getKeyspaceInstance(keyspaceName);
if (ks == null)
throw new IllegalArgumentException("Unknown keyspace " + keyspaceName);
if (pair.length == 1)
{View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Remove trailing commas and trailing dots from the cassandra.commitlog_replay_list value.
- Ensure each entry is exactly 'keyspace' or 'keyspace.table', e.g. 'ks1,ks2.tbl1'.
- If replaying everything, unset cassandra.commitlog_replay_list instead of passing an empty item.
- Validate the list programmatically before restart: split on ',', trim, and assert no empty or dot-terminated entries.
Example fix
// before -Dcassandra.commitlog_replay_list=ks1.,ks2 // IllegalArgumentException: Invalid pair: 'ks1.' // after -Dcassandra.commitlog_replay_list=ks1,ks2
Defensive patterns
Strategy: validation
Validate before calling
for (String item : replayList.split(",")) {
String t = item.trim();
if (t.isEmpty() || t.endsWith("."))
throw new IllegalArgumentException("Bad replay list item: '" + t + "'");
} Try / catch
try { CommitLogReplayer.create(...); } catch (IllegalArgumentException e) { logger.error("Bad commitlog_replay_list: {}", e.getMessage()); } Prevention
- Never leave trailing commas or trailing dots in the replay list
- Generate the list programmatically from schema metadata
- Test the property value on a staging node before production restart
When it happens
Trigger: Starting a node with -Dcassandra.commitlog_replay_list=KS1., or ',KS1', or double commas — i.e. any comma-separated item that is blank or ends in '.'.
Common situations: Hand-editing the replay list with trailing commas or a trailing dot after a keyspace name, script-generated option strings with empty entries, or copy/paste errors in operational runbooks.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- %s property contains an item which is not in format 'keyspac
- Unable to parse snapshot commit log position
- Commit log position must be given as <segment>,<position>
- Invalid value for system property: expected integer value bu
- Invalid value for system property: expected long value but g
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/c24c205968e5b466.
Report an issue: GitHub.