{"record":{"id":"da917ecfd00a1cff","repo":"apache/cassandra","slug":"some-directories-failed-to-import-check-server-lo","errorCode":null,"errorMessage":"Some directories failed to import, check server logs for details","messagePattern":"Some directories failed to import, check server logs for details","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/Import.java","lineNumber":129,"sourceCode":"\n        if (quick)\n        {\n            probe.output().out.println(\"Doing a quick import - skipping sstable verification and row cache invalidation\");\n            noVerifyTokens = true;\n            noInvalidateCaches = true;\n            noVerify = true;\n            extendedVerify = false;\n            noIndexValidation = true;\n        }\n        List<String> srcPaths = Lists.newArrayList(args.subList(2, args.size()));\n        List<String> failedDirs = probe.importNewSSTables(args.get(0), args.get(1), new HashSet<>(srcPaths), !keepLevel,\n                                                          !keepRepaired, !noVerify, !noVerifyTokens, !noInvalidateCaches,\n                                                          extendedVerify, copyData, failOnMissingIndex, !noIndexValidation);\n        if (!failedDirs.isEmpty())\n        {\n            for (String directory : failedDirs)\n                output.printError(directory);\n            throw new RuntimeException(IMPORT_FAIL_MESSAGE);\n        }\n    }\n}\n","sourceCodeStart":111,"sourceCodeEnd":133,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/Import.java#L111-L133","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Check the Cassandra server log (debug.log/system.log) for the per-directory import failure reason","Verify the directory path, file ownership/permissions, and that the SSTables belong to the given keyspace/table","Re-run with appropriate flags (e.g. --fail-on-missing-index or allow no-index-validation as intended) after fixing the offending directory","Retry the import for only the failed directories listed in the client output"],"exampleFix":"// before\nnodetool import ks tbl /restore/sstables   # fails: files belong to ks2.tbl\n// after\nnodetool import ks2 tbl /restore/sstables","handlingStrategy":"try-catch","validationCode":"# preflight: directory exists, readable, and contains SSTables for the right table\nls /restore/sstables/*-Data.db >/dev/null 2>&1 && grep -q \"$TABLE\" /restore/sstables/*/schema 2>/dev/null || echo \"verify SSTables belong to $KS.$TABLE\"","typeGuard":null,"tryCatchPattern":"try { runNodetool(\"import\", ks, table, dir); } catch (RuntimeException e) {\n    if (e.getMessage().contains(\"failed to import\")) { log(\"Check server debug.log for per-directory import errors\"); return; }\n    throw e;\n}","preventionTips":["Confirm SSTables belong to the target keyspace/table before import","Set correct file ownership/permissions for the Cassandra user on restore directories","Read the server log — the client only lists failed directory names","Avoid importing while heavy compactions run on the table"],"tags":["nodetool","import","sstable","compaction","server-side"],"backgroundTag":"http-error-response","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}