{"record":{"id":"9e4304087f6adab3","repo":"apache/cassandra","slug":"error-during-list-snapshot","errorCode":null,"errorMessage":"Error during list snapshot","messagePattern":"Error during list snapshot","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/ListSnapshots.java","lineNumber":120,"sourceCode":"                Set<?> values = snapshotDetail.getValue().keySet();\n                for (Object eachValue : values)\n                {\n                    final List<?> value = (List<?>) eachValue;\n                    if (includeEphemeral)\n                        table.add(value.subList(0, value.size() - 1).toArray(new String[value.size() - 1]));\n                    else\n                        table.add(value.subList(0, value.size() - 2).toArray(new String[value.size() - 2]));\n\n                    totalTrueDiskSize += (Long) value.get(value.size() - 1);\n                }\n            }\n            table.printTo(out);\n\n            out.println(\"\\nTotal TrueDiskSpaceUsed: \" + FileUtils.stringifyFileSize(totalTrueDiskSize) + '\\n');\n        }\n        catch (Exception e)\n        {\n            throw new RuntimeException(\"Error during list snapshot\", e);\n        }\n    }\n}\n","sourceCodeStart":102,"sourceCodeEnd":124,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/ListSnapshots.java#L102-L124","documentation":"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).","triggerScenarios":"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.","commonSituations":"Data directories partially restored from backup; snapshots created by a different Cassandra version; filesystem permission changes after a migration; disk errors.","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"],"exampleFix":"// before\nprobe.listSnapshots(...); // exception -> 'Error during list snapshot'\n// after\n// fix permissions/corrupt snapshots first:\n//   chown -R cassandra:cassandra /var/lib/cassandra/data\n// then rerun: nodetool listsnapshots","handlingStrategy":"try-catch","validationCode":"// check snapshot dirs are readable before listing\nFiles.isDirectory(Paths.get(dataDir, \"snapshots\"));","typeGuard":null,"tryCatchPattern":"try { nodetoolListSnapshots(); } catch (RuntimeException e) { if (e.getMessage().equals(\"Error during list snapshot\")) { /* check logs, permissions, corrupt snapshots */ } }","preventionTips":["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"],"tags":["snapshots","io","nodetool"],"backgroundTag":"file-read-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}