{"record":{"id":"c743ea7e8cdab6a8","repo":"apache/cassandra","slug":"error-during-taking-a-snapshot","errorCode":null,"errorMessage":"Error during taking a snapshot","messagePattern":"Error during taking a snapshot","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/Snapshot.java","lineNumber":118,"sourceCode":"            else\n            {\n                if (keyspaces.isEmpty())\n                    sb.append(\"[all keyspaces]\");\n                else\n                    sb.append('[').append(join(keyspaces, \", \")).append(']');\n\n                if (!snapshotName.isEmpty())\n                    sb.append(\" with snapshot name [\").append(snapshotName).append(']');\n                sb.append(\" and options \").append(options);\n                out.println(sb);\n\n                probe.takeSnapshot(snapshotName, table, options, toArray(keyspaces, String.class));\n                out.println(\"Snapshot directory: \" + snapshotName);\n            }\n        }\n        catch (IOException e)\n        {\n            throw new RuntimeException(\"Error during taking a snapshot\", e);\n        }\n    }\n}\n","sourceCodeStart":100,"sourceCodeEnd":122,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java#L100-L122","documentation":"nodetool snapshot wraps any IOException from probe.takeSnapshot (the JMX call to the node) into a RuntimeException with the message 'Error during taking a snapshot', preserving the cause. It signals the snapshot operation failed server-side or the JMX communication failed.","triggerScenarios":"The remote node fails while creating hard links (disk error, missing SSTable files, keyspace/table does not exist) or the JMX connection breaks mid-call.","commonSituations":"Snapshotting a nonexistent keyspace/table, disk-full or permission problems on the node, or flaky JMX connectivity to a busy node.","solutions":["Read the full stack trace and the cause; check the node's system.log for the underlying snapshot error.","Verify the keyspaces/tables passed exist (use nodetool describering or cqlsh DESCRIBE).","Check node disk space and permissions on the data/snapshots directories.","Verify JMX connectivity (nodetool status works) and retry."],"exampleFix":"// before (script ignores failure detail)\nnodetool snapshot -tn daily || exit 1\n// after\nnodetool snapshot -tn daily 2>&1 | tee snap.log || { cat snap.log; grep -A5 'Error during taking a snapshot' snap.log; exit 1; }","handlingStrategy":"try-catch","validationCode":"// Pre-check target exists: nodetool describering / cqlsh DESCRIBE KEYSPACES, and ensure JMX is reachable before snapshotting","typeGuard":null,"tryCatchPattern":"try { probe.takeSnapshot(name, table, options, keyspaces); } catch (RuntimeException e) { if (e.getMessage().equals(\"Error during taking a snapshot\")) { log(e.getCause()); checkNodeLogsAndDisk(); } else throw e; }","preventionTips":["Verify keyspaces/tables exist before snapshotting","Monitor node disk space; snapshots need no copy but hard links fail on some filesystems","Keep JMX healthy; test with nodetool status first"],"tags":["nodetool","snapshot","jmx"],"backgroundTag":"operation-failed-wrapped","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}