{"record":{"id":"dd2d1e0214d7b654","repo":"apache/cassandra","slug":"s-not-found-in-keyspace-s","errorCode":null,"errorMessage":"'%s' not found in keyspace '%s'","messagePattern":"'(.+?)' not found in keyspace '(.+?)'","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java","lineNumber":676,"sourceCode":"                }\n\n                KeyspaceMetadata keyspaceMetadata = validateKeyspace(ks, keyspaces);\n\n                if (keyspaceMetadata.tables.getNullable(name) != null)\n                    return table(ks, name);\n\n                Optional<TableMetadata> indexed = keyspaceMetadata.findIndexedTable(name);\n                if (indexed.isPresent())\n                {\n                    Optional<IndexMetadata> index = indexed.get().indexes.get(name);\n                    if (index.isPresent())\n                        return index(ks, name);\n                }\n\n                if (keyspaceMetadata.views.getNullable(name) != null)\n                    return view(ks, name);\n\n                throw invalidRequest(\"'%s' not found in keyspace '%s'\", name, ks);\n            }\n\n            @Override\n            protected Stream<? extends SchemaElement> describe(ClientState state, Keyspaces keyspaces)\n            {\n                delegate = resolve(state, keyspaces);\n                return delegate.describe(state, keyspaces);\n            }\n\n            @Override\n            protected List<ColumnSpecification> metadata(ClientState state)\n            {\n                return delegate.metadata(state);\n            }\n\n            @Override\n            protected List<ByteBuffer> toRow(SchemaElement element, boolean withInternals)\n            {","sourceCodeStart":658,"sourceCodeEnd":694,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java#L658-L694","documentation":"Thrown by the CQL DESCRIBE machinery in DescribeStatement when resolving an object name against a keyspace: the named table/type/index/view does not exist in the given keyspace. The library throws it because DESCRIBE was asked for an entity the schema cannot resolve. It is an InvalidRequestException raised from resolve() during describe().","triggerScenarios":"Running DESCRIBE TABLE/TYPE/INDEX/VIEW <name> (or calling DescribeStatement.execute/describe programmatically) where `name` matches no table, materialized view, or index in the resolved keyspace `ks`.","commonSituations":"Typo in table name; querying the wrong keyspace (missing USE or fully-qualified name); case sensitivity issues since unquoted identifiers are lowercased; the object was dropped by another client or was never created in this cluster/environment (e.g. staging vs prod).","solutions":["Verify the object exists with `DESCRIBE KEYSPACES` or `SELECT table_name FROM system_schema.tables WHERE keyspace_name = '<ks>'`","Correct the identifier spelling and respect case sensitivity: quote mixed-case names (\"MyTable\") or use lowercase","Fully qualify the name (keyspace.object) or run USE <keyspace> first to target the right keyspace","Check you are connected to the intended cluster/environment where the object was created"],"exampleFix":"// before\nDESCRIBE TABLE users_profiles; -- InvalidRequest: 'users_profiles' not found in keyspace 'myks'\n// after\nDESCRIBE TABLE myks.user_profiles; -- correct, existing table","handlingStrategy":"validation","validationCode":"Row[] rows = session.execute(\"SELECT table_name FROM system_schema.tables WHERE keyspace_name = ?\", ks).all();\nboolean exists = rows.stream().anyMatch(r -> r.getString(\"table_name\").equalsIgnoreCase(name));\nif (!exists) throw new IllegalArgumentException(name + \" not found in keyspace \" + ks);","typeGuard":null,"tryCatchPattern":"try { session.execute(\"DESCRIBE TABLE \" + name); }\ncatch (InvalidRequestException e) { /* handle missing object: e.g. create it or fall back */ }","preventionTips":["Check system_schema for the object's existence before DESCRIBE","Always fully qualify names with the keyspace","Remember unquoted identifiers are lowercased in CQL"],"tags":["cql","schema","not-found","invalid-request"],"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"}