apache/cassandra · error · BulkLoadException

Streaming to the following hosts failed:

Error message

Streaming to the following hosts failed:

What it means

BulkLoader.load() throws BulkLoadException when the streaming progress handler reports that one or more target hosts failed to receive the SSTables. The failed-host list and stack trace are printed to stderr first. See tools/sstableloader/src/org/apache/cassandra/tools/BulkLoader.java:124.

Source

Thrown at tools/sstableloader/src/org/apache/cassandra/tools/BulkLoader.java:124

        try
        {
            future.get();

            if (!options.noProgress)
            {
                indicator.printSummary(options.connectionsPerHost);
            }

            // Give sockets time to gracefully close
            Thread.sleep(1000);
        }
        catch (Exception e)
        {
            System.err.println("Streaming to the following hosts failed:");
            System.err.println(loader.getFailedHosts());
            e.printStackTrace(System.err);
            throw new BulkLoadException(e);
        }
    }

    // Return true when everything is at 100%
    static class ProgressIndicator implements StreamEventHandler
    {
        private final long start;
        private long lastProgress;
        private long lastTime;

        private long peak = 0;
        private int totalFiles = 0;

        private final Multimap<InetSocketAddress, SessionInfo> sessionsByHost = HashMultimap.create();

        public ProgressIndicator()
        {
            start = lastTime = nanoTime();

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Check the printed failed-host list and inspect those nodes' logs
  2. Verify the target keyspace/tables exist and schema matches the SSTables
  3. Free disk space / restart failed nodes, then re-run sstableloader (safe to re-run)
  4. Retry after network issues; ensure loader and cluster versions are compatible
Defensive patterns

Strategy: retry

Validate before calling

// before load: ensure all target hosts are up and the schema exists
for (String h : nodes.split(",")) new Socket(h.trim(), nativePort).close();
// session.execute("DESCRIBE KEYSPACE " + ks); // confirm keyspace exists

Try / catch

try {
    loader.load(options);
} catch (BulkLoadException e) {
    System.err.println("failed hosts: " + e.getMessage());
    // sstableloader is idempotent — safe to re-run after fixing the failing hosts
}

Prevention

When it happens

Trigger: Running sstableloader where the StreamResultFuture completes with getFailedHosts() non-empty — a target node rejects or drops the stream: node down mid-stream, disk full on the receiver, schema/handshake disagreement.

Common situations: Loading SSTables into a cluster where a replica runs out of disk; loader/cluster version mismatch; network interruption during transfer; keyspace/table missing on the target.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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