apache/cassandra · error · RuntimeException

Exception occured while executing

Error message

Exception occured while executing %s: %s

What it means

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.

Solutions

  1. Inspect the chained 'Caused by' exception; this message is only a wrapper and the root cause dictates the fix.
  2. Fix the underlying task failure (e.g. correct the older_than_timestamp format, free disk space, resolve permissions).
  3. Retry the snapshot operation once the underlying cause is resolved.
  4. If the cause is a prePopulateSnapshots conflict, use a unique snapshot tag or remove the existing snapshot first.

Example fix

// before
} catch (Throwable t) {
    log.error(t.getMessage()); // loses root cause
}
// after
} catch (RuntimeException t) {
    log.error("snapshot task failed", t.getCause());
}
Defensive patterns

Strategy: try-catch

Try / catch

try { SnapshotManager.instance.clearSnapshot(tag, ks); } catch (RuntimeException e) { log.error("Snapshot task failed: {}", e.getCause(), e); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/78743a9c05cb4de5. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/service/snapshot/SnapshotManager.java:543

        else if (notification instanceof TablePreScrubNotification)
        {
            ColumnFamilyStore cfs = ((TablePreScrubNotification) notification).cfs;
            SnapshotOptions opts = SnapshotOptions.systemSnapshot(cfs.name, SnapshotType.PRE_SCRUB, cfs.getKeyspaceTableName()).build();
            takeSnapshot(opts);
        }
    }

    @VisibleForTesting
    List<TableSnapshot> executeTask(TakeSnapshotTask task)
    {
        try
        {
            prePopulateSnapshots(task);
            return task.call();
        }
        catch (Throwable t)
        {
            throw new RuntimeException(String.format("Exception occured while executing %s: %s", task.toString(), t.getMessage()), t);
        }
    }

    @VisibleForTesting
    <T> T executeTask(AbstractSnapshotTask<T> task)
    {
        try
        {
            return task.call();
        }
        catch (Throwable t)
        {
            throw new RuntimeException(String.format("Exception occured while executing %s", task.toString()), t);
        }
    }

    /**
     * Add table snapshots to snaphots cow list in advance in order to be sure that the snapshots to be created

View on GitHub (pinned to 88fd0f6a0e)