{"record":{"id":"87564b84ad42d2fe","repo":"apache/cassandra","slug":"invalid-sstable-file-s-the-name-doesn-t-look-lik","errorCode":null,"errorMessage":"Invalid sstable file %s: the name doesn't look like a supported sstable file name","messagePattern":"Invalid sstable file (.+?): the name doesn't look like a supported sstable file name","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/io/sstable/Descriptor.java","lineNumber":409,"sourceCode":"        SSTableInfo info = validateAndExtractInfo(file);\n        return Pair.create(new Descriptor(info.version, parentOf(file.name(), file), keyspace, table, info.id), info.component);\n    }\n\n    private static List<String> filenameTokens(String name)\n    {\n        List<String> tokens = filenameSplitter.splitToList(name);\n        int size = tokens.size();\n\n        if (size != 4)\n        {\n            // This is an invalid sstable file for this version. But to provide a more helpful error message, we detect\n            // old format sstable, which had the format:\n            //   <keyspace>-<table>-(tmp-)?<version>-<gen>-<component>\n            // Note that we assume it's an old format sstable if it has the right number of tokens: this is not perfect\n            // but we're just trying to be helpful, not perfect.\n            if (size == 5 || size == 6)\n                throw new IllegalArgumentException(String.format(\"%s is of version %s which is now unsupported and cannot be read.\", name, tokens.get(size - 3)));\n            throw new IllegalArgumentException(String.format(\"Invalid sstable file %s: the name doesn't look like a supported sstable file name\", name));\n        }\n        return tokens;\n    }\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        }","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L391-L427","documentation":"Descriptor.filenameTokens() throws this generic IllegalArgumentException when a file name's token count/layout matches neither the current nor the recognizable legacy SSTable naming scheme, so Cassandra cannot even classify it as an unsupported-version SSTable. It indicates the file is not a valid component file for this directory (wrong placement, truncated name, or unrelated file).","triggerScenarios":"Files with malformed names sitting in an SSTable data directory while code iterates the directory calling Descriptor.tokens/fromFilename — e.g. partially renamed files, hand-edited names, non-SSTable files dropped into the table folder, or names missing gen/component segments.","commonSituations":"Manual file manipulation or scripts that rename SSTables; interrupted copy operations; foreign files (logs, editors' temp files) inside data directories.","solutions":["Inspect the offending file name from the message; if it is not a Cassandra component, move it out of the data directory","If it is a real component with a corrupted name, restore the correct name matching <table>-<uuid or version>-<gen>-<component> for your version, or redownload/recopy the file","Run a fresh backup restore rather than attempting to hand-patch names; verify directory layout (per-table subdirectories on 3.0+)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!file.getName().matches(\"[a-zA-Z0-9_]+-([a-z0-9-]+-)?\\\\d+-(big-)?[A-Za-z]+[.-].*\"))\n    System.out.println(\"Not a recognizable sstable component: \" + file.getName());","typeGuard":null,"tryCatchPattern":"try { Descriptor d = Descriptor.fromFilename(file); }\ncatch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Invalid sstable file\"))\n        // quarantine or remove the unparseable file\n}","preventionTips":["Never hand-rename SSTable component files","Exclude non-Cassandra files from data directories","Re-copy damaged components from backups instead of patching names"],"tags":["sstable","descriptor","file-naming"],"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"}