apache/cassandra · error · RuntimeException

Unable to parse snapshot commit log position

Error message

Unable to parse snapshot commit log position

What it means

Thrown when the 'snapshot_commitlog_position' property cannot be deserialized back into a CommitLogPosition. The value must be the serialized form produced by CommitLogPosition.serializer (epoch:position); malformed text raises ParseException or NumberFormatException, wrapped here.

Source

Thrown at src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java:185

            }
        }
        catch (DateTimeParseException e)
        {
            throw new RuntimeException("Unable to parse restore target time", e);
        }

        String snapshotPosition = commitlogCommands.getProperty("snapshot_commitlog_position");
        CommitLogPosition snapshotCommitLogPosition;
        try
        {

            snapshotCommitLogPosition = Strings.isNullOrEmpty(snapshotPosition)
                                        ? CommitLogPosition.NONE
                                        : CommitLogPosition.serializer.fromString(snapshotPosition);
        }
        catch (ParseException | NumberFormatException e)
        {
            throw new RuntimeException("Unable to parse snapshot commit log position", e);
        }

        return new CommitLogArchiver(archiveCommand,
                                     restoreCommand,
                                     restoreDirectories,
                                     restorePointInTime,
                                     snapshotCommitLogPosition,
                                     precision);
    }

    public void maybeArchive(final CommitLogSegment segment)
    {
        if (Strings.isNullOrEmpty(archiveCommand))
            return;

        archivePending.put(segment.getName(), executor.submit(new WrappedRunnable()
        {
            protected void runMayThrow() throws IOException

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Restore the exact serialized value from the snapshot's commitlog position (as written by Cassandra, e.g. epoch:position with numeric fields).
  2. Remove the property entirely (defaults to CommitLogPosition.NONE) if no snapshot position is needed.
  3. Re-derive the value from system tables/logs rather than hand-editing.
  4. Check the chained ParseException/NumberFormatException for the offending field.

Example fix

# before
snapshot_commitlog_position: 12:abc
# after
snapshot_commitlog_position: 12:10485760
Defensive patterns

Strategy: validation

Validate before calling

String s = props.getProperty("snapshot_commitlog_position");
if (s != null && !s.isEmpty() && !s.trim().matches("\\d+:\\d+"))
    throw new IllegalArgumentException("snapshot_commitlog_position must be 'epoch:position' numeric pair");

Try / catch

try { archiver = CommitLogArchiver.construct(); }
catch (RuntimeException e) {
    if ("Unable to parse snapshot commit log position".equals(e.getMessage()))
        log.error("snapshot_commitlog_position must be the serialized CommitLogPosition", e);
    throw e;
}

Prevention

When it happens

Trigger: getArchiverFromProperties() reads a snapshot_commitlog_position value that is not empty and not a valid serialized CommitLogPosition (wrong separator, non-numeric fields, hand-edited value).

Common situations: Hand-editing the properties file and mistyping the position; copying a position string from a different Cassandra version; truncating the value (e.g. '12:' or ':' alone); using human-readable formats instead of the serialized form.

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


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