{"record":{"id":"78743a9c05cb4de5","repo":"apache/cassandra","slug":"exception-occured-while-executing-s-s","errorCode":null,"errorMessage":"Exception occured while executing %s: %s","messagePattern":"Exception occured while executing (.+?): (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/snapshot/SnapshotManager.java","lineNumber":543,"sourceCode":"        else if (notification instanceof TablePreScrubNotification)\n        {\n            ColumnFamilyStore cfs = ((TablePreScrubNotification) notification).cfs;\n            SnapshotOptions opts = SnapshotOptions.systemSnapshot(cfs.name, SnapshotType.PRE_SCRUB, cfs.getKeyspaceTableName()).build();\n            takeSnapshot(opts);\n        }\n    }\n\n    @VisibleForTesting\n    List<TableSnapshot> executeTask(TakeSnapshotTask task)\n    {\n        try\n        {\n            prePopulateSnapshots(task);\n            return task.call();\n        }\n        catch (Throwable t)\n        {\n            throw new RuntimeException(String.format(\"Exception occured while executing %s: %s\", task.toString(), t.getMessage()), t);\n        }\n    }\n\n    @VisibleForTesting\n    <T> T executeTask(AbstractSnapshotTask<T> task)\n    {\n        try\n        {\n            return task.call();\n        }\n        catch (Throwable t)\n        {\n            throw new RuntimeException(String.format(\"Exception occured while executing %s\", task.toString()), t);\n        }\n    }\n\n    /**\n     * Add table snapshots to snaphots cow list in advance in order to be sure that the snapshots to be created","sourceCodeStart":525,"sourceCodeEnd":561,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/snapshot/SnapshotManager.java#L525-L561","documentation":"SnapshotManager.executeTask wraps any Throwable thrown by a snapshot task after prePopulateSnapshots into a RuntimeException prefixed 'Exception occured while executing'. The original exception is attached as the cause; the message summarizes the task and its message.","triggerScenarios":"Any AbstractSnapshotTask whose call() throws — e.g. an inner ClearSnapshotTask failing because older_than_timestamp is invalid, or a take/clear snapshot hitting IO errors — propagates through this wrapper.","commonSituations":"JMX/nodetool snapshot operations failing due to disk errors, invalid parameters, or concurrent snapshot conflicts; users see the wrapper message and must look at the cause.","solutions":["Inspect the chained 'Caused by' exception; this message is only a wrapper and the root cause dictates the fix.","Fix the underlying task failure (e.g. correct the older_than_timestamp format, free disk space, resolve permissions).","Retry the snapshot operation once the underlying cause is resolved.","If the cause is a prePopulateSnapshots conflict, use a unique snapshot tag or remove the existing snapshot first."],"exampleFix":"// before\n} catch (Throwable t) {\n    log.error(t.getMessage()); // loses root cause\n}\n// after\n} catch (RuntimeException t) {\n    log.error(\"snapshot task failed\", t.getCause());\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { SnapshotManager.instance.clearSnapshot(tag, ks); } catch (RuntimeException e) { log.error(\"Snapshot task failed: {}\", e.getCause(), e); }","preventionTips":["Always log the full exception, not just getMessage()","Validate snapshot parameters before invoking tasks","Fix root causes rather than retrying blindly"],"tags":["snapshot","wrapper-exception","runtimeexception"],"backgroundTag":"internal-invariant-violation","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"}