apache/cassandra · critical · RuntimeException

is corrupt, can't import

Error message

 is corrupt, can't import

What it means

After moving an SSTable, moveAndOpenSSTable() attempts open() on the new descriptor; if opening fails with any Throwable it logs that the descriptor was corrupt and rethrows a RuntimeException with '<descriptor> is corrupt, can't import' as the message and the original failure as the cause, aborting the import.

Source

Thrown at src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java:1915

                logger.warn("Unable to hardlink new SSTable {} to {}, falling back to copying", oldDescriptor, newDescriptor, ex);
                copy(oldDescriptor, newDescriptor, components);
            }
        }
        else
        {
            logger.info("Moving new SSTable {} to {}", oldDescriptor, newDescriptor);
            rename(oldDescriptor, newDescriptor, components);
        }

        SSTableReader reader;
        try
        {
            reader = open(cfs, newDescriptor, components, cfs.metadata);
        }
        catch (Throwable t)
        {
            logger.error("Aborting import of sstables. {} was corrupt", newDescriptor);
            throw new RuntimeException(newDescriptor + " is corrupt, can't import", t);
        }
        return reader;
    }

    public static void shutdownBlocking(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException
    {

        ExecutorUtils.shutdownNowAndWait(timeout, unit, syncExecutor);
        resetTidying();
    }

    /**
     * @return the physical size on disk of all components for this SSTable in bytes
     */
    public long bytesOnDisk()
    {
        return bytesOnDisk(false);
    }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Inspect the cause exception (sstablemetadata on the file) to identify the corrupt component
  2. Re-copy the SSTable set completely (all components) from the source and retry the import
  3. Use sstableloader instead of direct import; it validates and streams correctly
  4. Run nodetool repair to restore data from other replicas and then remove the corrupt files

Example fix

// before: copying only the Data file
scp node:/data/ks/tbl/xx-big-Data.db /data/ks/tbl/
// after: copy all components
scp 'node:/data/ks/tbl/xx-big-*' /data/ks/tbl/
Defensive patterns

Strategy: validation

Validate before calling

// validate the sstable before import
sstablemetadata <newDesc>/xx-big-Statistics.db
sstableverify or SortedTableVerifier.verify() before open

Try / catch

try { reader = SSTableReader.moveAndOpenSSTable(cfs, oldDesc, newDesc, comps, false); }
catch (RuntimeException e) {
    if (e.getMessage().endsWith("is corrupt, can't import")) {
        logger.error("Corrupt sstable {}, cause: {}", newDesc, e.getCause());
        reCopyAllComponentsAndRetry();
    } else throw e;
}

Prevention

When it happens

Trigger: open() throwing while reading the moved SSTable's components (missing/invalid Summary, Statistics, TOC, or Data file; checksum failures; wrong partitioner metadata) during an sstable import operation.

Common situations: Importing truncated or partially copied SSTables; files damaged during transfer between nodes; SSTables copied with missing secondary components; restoring incomplete backups.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


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