{"record":{"id":"df417b8f3290d1c6","repo":"apache/cassandra","slug":"unknown-table-df417b","errorCode":null,"errorMessage":"Unknown table ","messagePattern":"Unknown table ","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/TableHistograms.java","lineNumber":98,"sourceCode":"            tablesList.put(ksTbPair.left, ksTbPair.right);\n        }\n        else if (args.size() == 0)\n        {\n            // use all tables\n            tablesList = allTables;\n        }\n        else\n        {\n            throw new IllegalArgumentException(\"tablehistograms requires <keyspace> <table> or <keyspace.table> format argument.\");\n        }\n\n        // verify that all tables to list exist\n        for (String keyspace : tablesList.keys())\n        {\n            for (String table : tablesList.get(keyspace))\n            {\n                if (!allTables.containsEntry(keyspace, table))\n                    throw new IllegalArgumentException(\"Unknown table \" + keyspace + '.' + table);\n            }\n        }\n\n        for (String keyspace : tablesList.keys().elementSet())\n        {\n            for (String table : tablesList.get(keyspace))\n            {\n                // calculate percentile of row size and column count\n                long[] estimatedPartitionSize = (long[]) probe.getColumnFamilyMetric(keyspace, table, \"EstimatedPartitionSizeHistogram\");\n                long[] estimatedColumnCount = (long[]) probe.getColumnFamilyMetric(keyspace, table, \"EstimatedColumnCountHistogram\");\n\n                // build arrays to store percentile values\n                double[] estimatedRowSizePercentiles = new double[7];\n                double[] estimatedColumnCountPercentiles = new double[7];\n                double[] offsetPercentiles = new double[]{0.5, 0.75, 0.95, 0.98, 0.99};\n\n                if (ArrayUtils.isEmpty(estimatedPartitionSize) || ArrayUtils.isEmpty(estimatedColumnCount))\n                {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/TableHistograms.java#L80-L116","documentation":"Nodetool's TableHistograms command validates that every keyspace.table pair the user asked for actually exists in the cluster before querying. It builds the set of all live tables from StorageService and throws IllegalArgumentException when a requested pair is absent. It is a client-side preflight check to avoid querying a nonexistent table.","triggerScenarios":"Running `nodetool tablehistograms <ks> <table>` (or the -a/--keyspace/-t arguments) where the table name is misspelled, the keyspace does not exist, or the table was dropped before the command ran.","commonSituations":"Typos in table names; case-sensitivity mistakes (Cassandra lowercases unquoted identifiers but the argument is matched literally); running against a different cluster/environment than intended; automation scripts referencing a table removed by a migration.","solutions":["Run `nodetool listsnapshots`-style discovery instead: use `nodetool tablehistograms` with no args, or `nodetool cfstats`, to list valid keyspace/table names.","Correct the spelling and case of the keyspace and table arguments.","Verify you are connected to the intended cluster (check -h/-p port and JMX host).","Confirm the table still exists via cqlsh `DESCRIBE TABLES` in the keyspace."],"exampleFix":"// before\nnodetool tablehistograms myks MyTable\n// after\nnodetool tablehistograms myks mytable  // identifiers are stored lowercase unless quoted","handlingStrategy":"validation","validationCode":"String ks = args[0].toLowerCase(); String table = args[1].toLowerCase();\nboolean exists = java.util.Optional.ofNullable(StorageService.instance.getLocalHostId()) != null; // then check via listsnapshots/cfstats output\n// simplest guard: run `nodetool tablehistograms` with no args first and grep for ks+table","typeGuard":null,"tryCatchPattern":"try { runNodetool(\"tablehistograms\", ks, table); }\ncatch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unknown table\")) { /* fall back to listing valid tables */ } else throw e; }","preventionTips":["Always list tables first (`nodetool cfstats` or cqlsh DESCRIBE TABLES) before scripting per-table commands.","Lowercase identifiers in scripts since Cassandra stores unquoted identifiers lowercase.","Centralize keyspace/table name constants instead of hardcoding in multiple scripts."],"tags":["nodetool","cli","validation"],"backgroundTag":"invalid-cli-argument","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"}