apache/cassandra · error · IllegalArgumentException
cannot repair paxos in a preview repair
Error message
cannot repair paxos in a preview repair
What it means
ActiveRepairService.submitRepairSession refuses to create a repair session that combines Paxos repair with a preview repair. Preview repairs (irange/repairedAt previews) only estimate what a repair would do and never commit Merkle trees, so running a Paxos consistency repair in preview mode is meaningless and rejected up front with IllegalArgumentException.
Source
Thrown at src/java/org/apache/cassandra/service/ActiveRepairService.java:476
boolean excludedDeadNodes,
String keyspace,
RepairParallelism parallelismDegree,
boolean allReplicas,
boolean isIncremental,
boolean pullRepair,
PreviewKind previewKind,
boolean optimiseStreams,
boolean repairData,
boolean repairPaxos,
boolean dontPurgeTombstones,
boolean repairAccord,
boolean permitNoQuorum,
ExecutorPlus executor,
Scheduler validationScheduler,
String... cfnames)
{
if (repairPaxos && previewKind != PreviewKind.NONE)
throw new IllegalArgumentException("cannot repair paxos in a preview repair");
if (range.endpoints.isEmpty())
return null;
if (cfnames.length == 0)
return null;
final RepairSession session = new RepairSession(ctx, validationScheduler, parentRepairSession,
range, excludedDeadNodes, keyspace,
parallelismDegree, allReplicas, isIncremental, pullRepair,
previewKind, optimiseStreams, repairData, repairPaxos,
dontPurgeTombstones, repairAccord, permitNoQuorum, cfnames);
repairs.getIfPresent(parentRepairSession).register(session.state);
sessions.put(session.getId(), session);
// register listeners
registerOnFdAndGossip(session);
View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Remove the preview option (use PreviewKind.NONE) so the Paxos repair can actually run
- Remove the --repair-paxos flag when performing a preview repair
- If the goal is Paxos consistency, run a full (non-preview) repair: nodetool repair --paxos-only or a normal repair without preview flags
Example fix
// before storageService.repair(keyspace, options-with-preview-and-paxos); // throws // after Map<String,String> opts = new HashMap<>(); opts.put(RepairOption.PARALLELISM_KEY, "parallel"); opts.put(RepairOption.PAXOS_ONLY_KEY, "true"); // no preview storageService.repair(keyspace, opts);
Defensive patterns
Strategy: validation
Validate before calling
if (opts.paxosOnly || opts.repairPaxos) {
if (opts.preview || opts.previewKind !== 'NONE')
throw new Error('preview and paxos repair are mutually exclusive');
} Try / catch
try { repairSession(..., /*repairPaxos*/ true, /*previewKind*/ PreviewKind.NONE, ...); }
catch (IllegalArgumentException e) { log.error("preview+paxos conflict", e); } Prevention
- Never combine preview flags with --repair-paxos / paxos-only in repair scripts
- Validate RepairOption maps before handing them to StorageService.repair
When it happens
Trigger: Calling RepairSession/submitRepairSession with repairPaxos=true while previewKind != PreviewKind.NONE, e.g. running nodetool repair with --repair-paxos together with --preview, or invoking the JMX/API repair path with both options set.
Common situations: Operators scripting nodetool repair combining flags like -pr/--repair-paxos with preview or incremental-repair-adjacent options; automated repair schedulers that set preview kind globally without clearing paxos repair.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Cannot run paxos only repair on %s.%s, which isn't configure
- Cannot run paxos only repair on %s.%s, which isn't configure
- Cannot run accord only repair on %s.%s, which isn't configur
- Not running paxos repair for topology change because paxos r
- Not running paxos repair for topology change because there a
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/97d1b3f73217601e.
Report an issue: GitHub.