apache/cassandra · error · RuntimeException

Got error while relocating

Error message

Got error while relocating

What it means

Nodetool RelocateSSTables wraps any exception from the JMX relocateSSTables call in a RuntimeException 'Got error while relocating'. Relocation moves SSTables between nodes/disks without streaming; the failure is node-side and surfaced via the wrapped cause.

Source

Thrown at src/java/org/apache/cassandra/tools/nodetool/RelocateSSTables.java:65

            names = { "-j", "--jobs" },
            description = "Number of sstables to relocate simultanously, set to 0 to use all available compaction threads")
    private int jobs = 2;

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

        List<String> keyspaces = parseOptionalKeyspace(args, probe);
        String[] cfnames = parseOptionalTables(args);
        try
        {
            for (String keyspace : keyspaces)
                probe.relocateSSTables(jobs, keyspace, cfnames);
        }
        catch (Exception e)
        {
            throw new RuntimeException("Got error while relocating", e);
        }
    }
}

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Inspect the wrapped cause and node logs
  2. Verify keyspace/table names
  3. Check for conflicting compaction/cleanup activity (`nodetool compactionstats`)
  4. Retry with jobs=0 once the node is idle

Example fix

// before
nodetool relocate_sstables --jobs -5
// after
nodetool relocate_sstables --jobs 0
Defensive patterns

Strategy: try-catch

Validate before calling

nodetool compactionstats | head -5  # ensure node not busy before relocating

Try / catch

try { probe.relocateSSTables(jobs, ks, tables); } catch (RuntimeException e) { log.error("relocate failed: {}", e.getCause(), e); throw e; }

Prevention

When it happens

Trigger: `nodetool relocate_sstables` (optionally with keyspace/tables/jobs) when the remote relocation request fails: invalid table names, bad jobs parameter, IO/JMX errors.

Common situations: Running after a topology/disk change with mismatched table names; concurrent cleanup/compaction operations; JMX connectivity problems.

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/77be7620c0f7a991. Report an issue: GitHub.