apache/cassandra · error · RuntimeException

Error occurred during enabling auto-compaction

Error message

Error occurred during enabling auto-compaction

What it means

Nodetool RecompressSSTables wraps any exception from the JMX recompressSSTables call in a RuntimeException with a misleading message ('Error occurred during enabling auto-compaction' — copied from the SetAutoCompaction tool). It signals the actual recompression request failed, not auto-compaction state.

Solutions

  1. Read the wrapped cause for the real failure and check node logs
  2. Verify keyspace/table names with `nodetool describecluster`/sstablemetadata or cqlsh DESCRIBE
  3. Use a valid jobs count (0 lets the node decide)
  4. Ensure no conflicting compaction operation is running (`nodetool compactionstats`)

Example fix

// before
nodetool recompress_sstables myks wrong_table
// after
nodetool recompress_sstables myks correct_table
Defensive patterns

Strategy: try-catch

Validate before calling

nodetool compactionstats | grep -q recompress && echo "recompression already running"

Try / catch

try { probe.recompressSSTables(out, ks, jobs, tables); } catch (RuntimeException e) { Throwable cause = e.getCause(); log.warn("recompress failed: {}", cause == null ? e : cause.getMessage()); throw e; }

Prevention

When it happens

Trigger: `nodetool recompress_sstables` (with optional keyspace/tables/jobs) when the node-side recompression cannot start: unknown table, invalid jobs value, concurrent compaction conflicts, or any IOException/remote exception over JMX.

Common situations: Typo'd table names; passing a jobs number the node rejects; running during ongoing compactions; JMX connection issues.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/nodetool/RecompressSSTables.java:67

    private int jobs = 2;

    @Override
    public void execute(NodeProbe probe)
    {
        args = concatArgs(keyspace, tables);

        List<String> keyspaces = parseOptionalKeyspace(args, probe);
        String[] tableNames = parseOptionalTables(args);

        for (String keyspace : keyspaces)
        {
            try
            {
                probe.recompressSSTables(probe.output().out, keyspace, jobs, tableNames);
            }
            catch (Exception e)
            {
                throw new RuntimeException("Error occurred during enabling auto-compaction", e);
            }
        }
    }
}

View on GitHub (pinned to 88fd0f6a0e)