{"record":{"id":"9afab25c0d99fd4e","repo":"apache/cassandra","slug":"unknown-keyspace-table-s-s-9afab2","errorCode":null,"errorMessage":"Unknown keyspace/table %s.%s","messagePattern":"Unknown keyspace/table (.+?)\\.(.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/StandaloneUpgrader.java","lineNumber":68,"sourceCode":"public class StandaloneUpgrader\n{\n    private static final String TOOL_NAME = \"sstableupgrade\";\n    private static final String DEBUG_OPTION  = \"debug\";\n    private static final String HELP_OPTION  = \"help\";\n    private static final String KEEP_SOURCE = \"keep-source\";\n\n    public static void main(String args[])\n    {\n        Options options = Options.parseArgs(args);\n        if (TEST_UTIL_ALLOW_TOOL_REINIT_FOR_TEST.getBoolean())\n            DatabaseDescriptor.toolInitialization(false); //Necessary for testing\n        else\n            Util.initDatabaseDescriptor();\n        ClusterMetadataService.initializeForTools(false);\n        try\n        {\n            if (Schema.instance.getTableMetadata(options.keyspace, options.cf) == null)\n                throw new IllegalArgumentException(String.format(\"Unknown keyspace/table %s.%s\",\n                                                                 options.keyspace,\n                                                                 options.cf));\n\n            Keyspace keyspace = Keyspace.openWithoutSSTables(options.keyspace);\n            ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(options.cf);\n\n            OutputHandler handler = new OutputHandler.SystemOutput(false, options.debug);\n            Directories.SSTableLister lister = cfs.getDirectories().sstableLister(Directories.OnTxnErr.THROW);\n            if (options.snapshot != null)\n                lister.onlyBackups(true).snapshots(options.snapshot);\n            else\n                lister.includeBackups(false);\n\n            Collection<SSTableReader> readers = new ArrayList<>();\n\n            // Upgrade sstables in id order\n            for (Map.Entry<Descriptor, Set<Component>> entry : lister.sortedList())\n            {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java#L50-L86","documentation":"StandaloneUpgrader.main verifies that Schema.instance.getTableMetadata(options.keyspace, options.cf) resolves after offline initialization. If the keyspace/table pair is unknown, it throws IllegalArgumentException because the upgrader needs the table's metadata to rewrite SSTables.","triggerScenarios":"Running the standalone upgrader with a --keyspace/--cf pair that does not exist in the loaded schema.","commonSituations":"Typo or wrong-case table name; upgrading sstables copied from a cluster whose schema differs; table dropped before the tool ran; running against a node that hasn't loaded the schema.","solutions":["Confirm the exact keyspace/table names via cqlsh and correct the arguments","Run the tool on a node that has the table in its schema (correct config/data paths)","Restore the schema if the table was dropped and the sstables must be upgraded"],"exampleFix":"// before\nStandaloneUpgrader ks1 Usres /path/to/snapshots\n// after\nStandaloneUpgrader ks1 users /path/to/snapshots","handlingStrategy":"validation","validationCode":"if (Schema.instance.getTableMetadata(ks, cf) == null)\n    throw new IllegalArgumentException(\"Unknown keyspace/table \" + ks + \".\" + cf);","typeGuard":null,"tryCatchPattern":"try { StandaloneUpgrader.main(args); }\ncatch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"Unknown keyspace/table\")) {\n        // correct keyspace/cf arguments\n    } else throw e;\n}","preventionTips":["Confirm names with cqlsh before upgrading sstables","Ensure the target node has the table's schema","Restore schema before upgrading sstables from a dropped table"],"tags":["cli","schema","offline-tools"],"backgroundTag":"resource-not-found","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"}