apache/cassandra · error · RuntimeException
Error during clearing snapshots
Error message
Error during clearing snapshots
What it means
Nodetool's ClearSnapshot wraps any IOException from the JMX call NodeProbe.clearSnapshot (which invokes StorageServiceMBean.takeSnapshot-style snapshot removal remotely) into a RuntimeException. It means the nodetool client could not communicate the clear-snapshots request to the node or the operation failed at the transport level. The snapshot data itself is not removed.
Source
Thrown at src/java/org/apache/cassandra/tools/nodetool/ClearSnapshot.java:129
if (olderThanTimestamp != null)
sb.append(" older than timestamp ").append(olderThanTimestamp);
probe.output().out.println(sb);
try
{
Map<String, Object> parameters = new HashMap<>();
if (olderThan != null)
parameters.put("older_than", olderThan);
if (olderThanTimestamp != null)
parameters.put("older_than_timestamp", olderThanTimestamp);
probe.clearSnapshot(parameters, snapshotName, toArray(keyspaces, String.class));
}
catch (IOException e)
{
throw new RuntimeException("Error during clearing snapshots", e);
}
}
}
View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Verify the node is up and JMX is reachable: `nodetool status` against the same host/port.
- Check JMX connection settings (-p port, -u/-pw, SSL flags) in the nodetool command.
- Inspect the wrapped cause (printed as 'Caused by') for the underlying IOException detail.
- Retry after the node recovers; snapshot clearing is idempotent.
Example fix
// before nodetool -h 10.0.0.5 clearsnapshot // after nodetool -h 10.0.0.5 -p 7199 -u jmxuser -pw jmxpass clearsnapshot # correct port/creds
Defensive patterns
Strategy: try-catch
Validate before calling
// check JMX reachability before clearing
try (JMXConnector c = JMXConnectorFactory.connect(new JMXServiceURL("service:jmx:rmi:///jndi/rmi://host:7199/jmxrmi"))) {
c.getMBeanServerConnection().getDomains(); // probe connectivity
} Try / catch
try { probe.clearSnapshot(params, name, keyspaces); }
catch (RuntimeException e) {
Throwable cause = e.getCause();
if (cause instanceof java.io.IOException) { /* node unreachable; alert + retry later */ }
else throw e;
} Prevention
- Monitor JMX port availability before scripting snapshot cleanup.
- Pin JMX credentials/SSL settings in nodetool config files.
- Run clearsnapshot during stable cluster state, not during restarts.
- Always read the 'Caused by' chain to distinguish connectivity from remote failure.
When it happens
Trigger: Running `nodetool clearsnapshot` (with optional --before-timestamp, snapshot names, or keyspaces) when the JMX connection to the node breaks or the remote call throws IOException, e.g. node down mid-command or JMX auth/SSL failure.
Common situations: JMX port (default 7199) wrong or firewalled; Cassandra node stopped or crashed while clearing snapshots; JMX remote SSL/username-password misconfiguration; connecting to a node of a mismatched Cassandra version.
Related errors
- throw new IOException(e)
- throw new IOException(e.getMessage())
- Error during list snapshot
- Could not retrieve list of stat mbeans.
- Error while refreshing system.size_estimates
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/bf29d8611d9ef56d.
Report an issue: GitHub.