apache/cassandra · error · RuntimeException

Some directories failed to import, check server logs for det

Error message

Some directories failed to import, check server logs for details

What it means

The Import nodetool command triggers server-side SSTable import (via JMX/StorageService) and inspects the returned list of failed directories. If any directory failed to import, it prints each failed directory via output.printError and throws RuntimeException('Some directories failed to import, check server logs for details'). The per-directory reason is only in the server log, not the client.

Source

Thrown at src/java/org/apache/cassandra/tools/nodetool/Import.java:129

        if (quick)
        {
            probe.output().out.println("Doing a quick import - skipping sstable verification and row cache invalidation");
            noVerifyTokens = true;
            noInvalidateCaches = true;
            noVerify = true;
            extendedVerify = false;
            noIndexValidation = true;
        }
        List<String> srcPaths = Lists.newArrayList(args.subList(2, args.size()));
        List<String> failedDirs = probe.importNewSSTables(args.get(0), args.get(1), new HashSet<>(srcPaths), !keepLevel,
                                                          !keepRepaired, !noVerify, !noVerifyTokens, !noInvalidateCaches,
                                                          extendedVerify, copyData, failOnMissingIndex, !noIndexValidation);
        if (!failedDirs.isEmpty())
        {
            for (String directory : failedDirs)
                output.printError(directory);
            throw new RuntimeException(IMPORT_FAIL_MESSAGE);
        }
    }
}

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Check the Cassandra server log (debug.log/system.log) for the per-directory import failure reason
  2. Verify the directory path, file ownership/permissions, and that the SSTables belong to the given keyspace/table
  3. Re-run with appropriate flags (e.g. --fail-on-missing-index or allow no-index-validation as intended) after fixing the offending directory
  4. Retry the import for only the failed directories listed in the client output

Example fix

// before
nodetool import ks tbl /restore/sstables   # fails: files belong to ks2.tbl
// after
nodetool import ks2 tbl /restore/sstables
Defensive patterns

Strategy: try-catch

Validate before calling

# preflight: directory exists, readable, and contains SSTables for the right table
ls /restore/sstables/*-Data.db >/dev/null 2>&1 && grep -q "$TABLE" /restore/sstables/*/schema 2>/dev/null || echo "verify SSTables belong to $KS.$TABLE"

Try / catch

try { runNodetool("import", ks, table, dir); } catch (RuntimeException e) {
    if (e.getMessage().contains("failed to import")) { log("Check server debug.log for per-directory import errors"); return; }
    throw e;
}

Prevention

When it happens

Trigger: `nodetool import <keyspace> <table> <dir...>` where one or more directories fail validation or import on the server: missing/wrong directory, files not belonging to the table, unreadable files, index validation failures (failOnMissingIndex / noIndexValidation), or concurrent compaction interference.

Common situations: Copying SSTables back into a restore directory with wrong ownership/permissions; importing a directory whose files belong to a different table schema; forgetting extendedVerify when index validation matters; import while the node is mid-compaction.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


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