apache/cassandra · error · RuntimeException
Error during list snapshot
Error message
Error during list snapshot
What it means
ListSnapshots builds a report of existing snapshots from StorageServiceMBean.listSnapshots; any exception during retrieval or report rendering is wrapped in RuntimeException('Error during list snapshot'). It indicates snapshot metadata could not be fetched (e.g. a snapshot directory is corrupt or an MBean call failed).
Source
Thrown at src/java/org/apache/cassandra/tools/nodetool/ListSnapshots.java:120
Set<?> values = snapshotDetail.getValue().keySet();
for (Object eachValue : values)
{
final List<?> value = (List<?>) eachValue;
if (includeEphemeral)
table.add(value.subList(0, value.size() - 1).toArray(new String[value.size() - 1]));
else
table.add(value.subList(0, value.size() - 2).toArray(new String[value.size() - 2]));
totalTrueDiskSize += (Long) value.get(value.size() - 1);
}
}
table.printTo(out);
out.println("\nTotal TrueDiskSpaceUsed: " + FileUtils.stringifyFileSize(totalTrueDiskSize) + '\n');
}
catch (Exception e)
{
throw new RuntimeException("Error during list snapshot", e);
}
}
}
View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Check node logs for the exception root cause under the snapshot listing path
- Verify data directory permissions for the cassandra user
- Inspect/repair snapshot directories under the data dirs; remove corrupt snapshot folders
- If caused by version mismatch, run listsnapshots from the matching nodetool version
Example fix
// before probe.listSnapshots(...); // exception -> 'Error during list snapshot' // after // fix permissions/corrupt snapshots first: // chown -R cassandra:cassandra /var/lib/cassandra/data // then rerun: nodetool listsnapshots
Defensive patterns
Strategy: try-catch
Validate before calling
// check snapshot dirs are readable before listing Files.isDirectory(Paths.get(dataDir, "snapshots"));
Try / catch
try { nodetoolListSnapshots(); } catch (RuntimeException e) { if (e.getMessage().equals("Error during list snapshot")) { /* check logs, permissions, corrupt snapshots */ } } Prevention
- Keep data directory ownership/permissions correct for the cassandra user
- Clean up snapshots from incompatible versions
- Monitor disks for I/O errors that corrupt snapshot manifests
When it happens
Trigger: Running `nodetool listsnapshots` (or executeLocally) when the node cannot enumerate snapshot dirs — corrupt snapshot manifest, permission problems on the data dirs, or internal errors in snapshot handling.
Common situations: Data directories partially restored from backup; snapshots created by a different Cassandra version; filesystem permission changes after a migration; disk errors.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- Error during clearing snapshots
- throw new IOException(e)
- throw new IOException(e.getMessage())
- java.io.IOException
- Specify snapshot name or --all
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/9e4304087f6adab3.
Report an issue: GitHub.