{"record":{"id":"d35f5acc88af2f0d","repo":"apache/cassandra","slug":"invalid-sstable-file-s-the-id-part-s-of-the","errorCode":null,"errorMessage":"Invalid sstable file %s: the 'id' part (%s) of the name doesn't parse as a valid unique identifier","messagePattern":"Invalid sstable file (.+?): the 'id' part \\((.+?)\\) of the name doesn't parse as a valid unique identifier","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/io/sstable/Descriptor.java","lineNumber":430,"sourceCode":"    }\n\n    private static SSTableInfo validateAndExtractInfo(File file)\n    {\n        String name = file.name();\n        List<String> tokens = filenameTokens(name);\n\n        String versionString = tokens.get(0);\n        if (!Version.validate(versionString))\n            throw invalidSSTable(name, \"invalid version %s\", versionString);\n\n        SSTableId id;\n        try\n        {\n            id = SSTableIdFactory.instance.fromString(tokens.get(1));\n        }\n        catch (RuntimeException e)\n        {\n            throw invalidSSTable(name, \"the 'id' part (%s) of the name doesn't parse as a valid unique identifier\", tokens.get(1));\n        }\n\n        SSTableFormat<?, ?> format = formatFromName(name, tokens);\n        Component component = Component.parse(tokens.get(3), format);\n\n        Version version = format.getVersion(versionString);\n        if (!version.isCompatible())\n            throw invalidSSTable(name, \"incompatible sstable version (%s); you should have run upgradesstables before upgrading\", versionString);\n\n        return new SSTableInfo(version, id, component);\n    }\n\n    private static class SSTableInfo\n    {\n        final Version version;\n        final SSTableId id;\n        final Component component;\n","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L412-L448","documentation":"Modern sstable names embed a globally unique identifier as the second token, parsed by SSTableIdFactory.instance.fromString(). If that parsing throws a RuntimeException, validateAndExtractInfo wraps it in this invalidSSTable exception: the 'id' token does not represent a valid unique identifier, so the descriptor cannot be constructed.","triggerScenarios":"Descriptor.info(file)/fromFilename where the second underscore-token of the filename is not parseable as an SSTableId (e.g. legacy numeric generation where the build expects UUID-like ids, or corrupted/renamed tokens).","commonSituations":"Mixing sstable naming generations (old numeric-generation files vs new UUID-id files) after upgrade or restore; hand-edited filenames; copying files from incompatible versions.","solutions":["Fix the filename if the id token was corrupted or renamed; restore the original name from backup/snapshot metadata.","Confirm the file comes from a compatible Cassandra version that emits the expected SSTableId format.","Use the upgrade tooling (upgradeSSTables) to regenerate files in the expected naming scheme.","Remove files that are not genuine sstable components of this table from the data directory."],"exampleFix":"// before\nmc-notanid-big-Data.db    // second token 'notanid' is not an SSTableId\n// after\nmc-1g-7big-Data.db        // token parses as a valid unique identifier (per SSTableIdFactory)","handlingStrategy":"validation","validationCode":"try { SSTableIdFactory.instance.fromString(filenameTokens.get(1)); }\ncatch (RuntimeException e) { throw new IllegalStateException(\"Bad sstable id token: \" + filenameTokens.get(1)); }","typeGuard":null,"tryCatchPattern":"try { Descriptor.Info info = Descriptor.fromFilename(file); }\ncatch (Throwable e) { if (e.getMessage() != null && e.getMessage().contains(\"doesn't parse as a valid unique identifier\")) { /* restore original filename from backup */ } else throw e; }","preventionTips":["Preserve original sstable filenames from snapshots/backups verbatim.","Do not mix pre/post-UUID-generation sstable naming across versions.","Run upgradeSSTables to normalize naming after upgrades.","Quarantine suspicious files instead of editing their names."],"tags":["sstable","descriptor","filename-parsing","identifier"],"backgroundTag":"invalid-identifier-format","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}