{"record":{"id":"75c919791ba1adae","repo":"apache/cassandra","slug":"unknown-tables-verifier-get-ks-in-keyspa","errorCode":null,"errorMessage":"Unknown tables: \" + verifier.get(ks) + \" in keyspace: \" + ks","messagePattern":"Unknown tables: \" \\+ verifier\\.get\\(ks\\) \\+ \" in keyspace: \" \\+ ks","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsHolder.java","lineNumber":650,"sourceCode":"\n            // Note that if there is any table for the keyspace, we want to include the keyspace irregarding\n            // of the ignoreMode, since the ignoreMode then apply to the table inside the keyspace but the\n            // keyspace itself is not ignored\n            return filter.get(keyspace) != null || ignoreMode;\n        }\n\n        public void verifyKeyspaces(Collection<String> keyspaces)\n        {\n            for (String ks : verifier.keySet())\n                if (!keyspaces.contains(ks))\n                    throw new IllegalArgumentException(\"Unknown keyspace: \" + ks);\n        }\n\n        public void verifyTables()\n        {\n            for (String ks : filter.keySet())\n                if (!verifier.get(ks).isEmpty())\n                    throw new IllegalArgumentException(\"Unknown tables: \" + verifier.get(ks) + \" in keyspace: \" + ks);\n        }\n    }\n}\n","sourceCodeStart":632,"sourceCodeEnd":654,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsHolder.java#L632-L654","documentation":"OptionFilter.verifyTables checks that every table name given to nodetool tablestats exists within its specified keyspace. Any table names that were requested but not found under the filter's keyspace are reported in an IllegalArgumentException. This prevents silently returning empty/partial stats for misnamed tables.","triggerScenarios":"`nodetool tablestats ks1.table1 ks1.bogus_table` where bogus_table does not exist in ks1; or supplying a table with no keyspace qualifier that matches no table.","commonSituations":"Typos in table names; renamed or dropped tables; confusion between table name and the underlying SSTable file name; case-sensitivity mistakes.","solutions":["List the actual tables with `nodetool tables <keyspace>` or query system_schema.tables and use exact names","Re-run with corrected table names","Omit table arguments to gather stats for every table in the keyspace"],"exampleFix":"// before\nnodetool tablestats my_ks.user_tabel\n// after\nnodetool tablestats my_ks.users","handlingStrategy":"validation","validationCode":"Set<String> tables = session.execute(\"SELECT table_name FROM system_schema.tables WHERE keyspace_name = ?\", ks).all().stream().map(r -> r.getString(0)).collect(Collectors.toSet());\nif (!tables.contains(table)) throw new IllegalArgumentException(\"Unknown table: \" + table);","typeGuard":null,"tryCatchPattern":"try { runNodetool(args); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unknown tables:\")) { /* list system_schema.tables for the keyspace */ } else throw e; }","preventionTips":["Verify table names with `nodetool tablenames <ks>` / system_schema.tables","Use the exact case as defined at CREATE TABLE","Re-check names after schema changes or migrations"],"tags":["cassandra","nodetool","validation"],"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-17T15:17:12.973Z"}