{"record":{"id":"588c107606f0a1cf","repo":"apache/cassandra","slug":"unknown-keyspace-keyspacename-588c10","errorCode":null,"errorMessage":"Unknown keyspace: '\" + keyspaceName + \"'","messagePattern":"Unknown keyspace: '\" \\+ keyspaceName \\+ \"'","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java","lineNumber":895,"sourceCode":"                        ')', UTF8Type.instance));\n        }\n\n        @Override\n        public DataSet data()\n        {\n            ConsensusMigrationState snapshot = ClusterMetadata.current().consensusMigrationState;\n            Collection<TableMigrationState> tableStates = snapshot.tableStates();\n            return data(tableStates);\n        }\n\n        @Override\n        public DataSet data(DecoratedKey key)\n        {\n            String keyspaceName = UTF8Type.instance.compose(key.getKey());\n            Keyspace keyspace = Schema.instance.getKeyspaceInstance(keyspaceName);\n\n            if (keyspace == null)\n                throw new InvalidRequestException(\"Unknown keyspace: '\" + keyspaceName + '\\'');\n\n            List<TableId> tableIDs = keyspace.getColumnFamilyStores()\n                                             .stream()\n                                             .map(ColumnFamilyStore::getTableId)\n                                             .collect(Collectors.toList());\n\n            ConsensusMigrationState snapshot = ClusterMetadata.current().consensusMigrationState;\n            Collection<TableMigrationState> tableStates = snapshot.tableStatesFor(tableIDs);\n\n            return data(tableStates);\n        }\n\n        private SimpleDataSet data(Collection<TableMigrationState> tableStates)\n        {\n            SimpleDataSet result = new SimpleDataSet(metadata());\n\n            for (TableMigrationState state : tableStates)\n            {","sourceCodeStart":877,"sourceCodeEnd":913,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java#L877-L913","documentation":"The accord_debug.histo table's DataSet resolver maps a row's partition key to a keyspace name and requires a live keyspace instance. Schema.instance.getKeyspaceInstance() returns null for keyspaces that exist only in schema metadata (or not at all), and the resolver then throws InvalidRequestException with the unknown name.","triggerScenarios":"Querying a histo row whose key names a keyspace that is dropped, not yet instantiated on this node, or misspelled; reading rows after the keyspace was dropped while stale rows are still addressable.","commonSituations":"Inspecting Accord histogram debug rows after dropping a keyspace; typo in keyspace name within the partition key; node that never opened the keyspace (e.g. it has no local replicas).","solutions":["Verify the keyspace name spelled in the partition key matches an existing, instantiated keyspace (check system_schema.keyspaces).","Run the query on a node that has a live instance of the keyspace (i.e. holds replicas or has it opened).","Recreate/re-open the keyspace if it was dropped and the debug rows are still needed.","Ignore stale histo rows for dropped keyspaces rather than querying them."],"exampleFix":"// before\nsession.execute(\"SELECT * FROM system_views.accord_debug_histo WHERE key = 'ks2'\"); // ks2 dropped\n// after\nResultSet check = session.execute(\"SELECT keyspace_name FROM system_schema.keyspaces WHERE keyspace_name = 'ks1'\");\nif (!check.isEmpty()) session.execute(\"SELECT * FROM system_views.accord_debug_histo WHERE key = 'ks1'\");","handlingStrategy":"validation","validationCode":"ResultSet rs = session.execute(\"SELECT keyspace_name FROM system_schema.keyspaces WHERE keyspace_name = ?\", ks);\nif (rs.isEmpty()) throw new IllegalArgumentException(\"Keyspace does not exist: \" + ks);","typeGuard":null,"tryCatchPattern":"try { session.execute(histoQuery); } catch (com.datastax.driver.core.exceptions.InvalidQueryException e) { if (e.getMessage().startsWith(\"Unknown keyspace\")) { /* keyspace dropped or not instantiated; skip stale rows */ } else throw e; }","preventionTips":["Verify keyspace exists via system_schema before querying histo rows","Run debug queries on nodes that host the keyspace","Treat histo rows for dropped keyspaces as stale and skip them"],"tags":["keyspace","accord","virtual-table","resource-not-found","cassandra"],"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"}