apache/cassandra · error · RuntimeException
Unable to find table
Error message
Unable to find table ${keyspaceName}.${tableName} What it means
maybeLoadSchemaInfo looks up the table metadata via the Cassandra java driver's cluster metadata. If the keyspace or quoted table cannot be found (getTable returns null), a RuntimeException is thrown. This happens when the profile references a table that does not exist in the connected cluster.
Solutions
- Verify the keyspace and table exist with CQL: DESCRIBE KEYSPACE / DESCRIBE TABLE
- Correct the keyspace/table name in the stress profile YAML
- Ensure the cluster is connected to the right host and the schema has been created (run the profile's schema creation step)
- Check replication/schema agreement - a just-created schema may not have propagated yet
Example fix
# before keyspace: ks1 table: user # after (after creating the table in CQL) keyspace: ks1 table: users
Defensive patterns
Strategy: validation
Validate before calling
// pre-check schema via driver session
ResultSet rs = session.execute("SELECT table_name FROM system_schema.tables WHERE keyspace_name=? AND table_name=?", keyspace, table);
if (rs.all().isEmpty()) throw new IllegalStateException("table missing: " + keyspace + "." + table); Try / catch
try { profile.getInsert(...); } catch (RuntimeException e) { if (e.getMessage().startsWith("Unable to find table")) { createSchema(); retry(); } else throw e; } Prevention
- DESCRIBE the keyspace/table before running stress
- Ensure schema creation step completed (maybeCreateSchema)
- Watch for schema-agreement delays after CREATE TABLE
- Verify you connect to the intended cluster/datacenter
When it happens
Trigger: maybeLoadSchemaInfo invoked (directly or via maybeCreateSchema, maybeLoadTokenRanges, getInsert, getValidate, newGenerator) when the keyspace/table named in the stress YAML does not exist in cluster metadata.
Common situations: Typo in table or keyspace name in the YAML, schema not yet created (maybeCreateSchema failed or was skipped), connecting to the wrong cluster/datacenter, case-sensitive identifiers needing quoting.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- ACCESS TO DATACENTERS operations not supported by…
- ALREADY_EXISTS
- Already exists
- Because of this name
- Cannot add new field
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/c9f20876a88d5109.
Report an issue: GitHub.
Appendix: source
Thrown at tools/stress/src/org/apache/cassandra/stress/StressProfile.java:350
private void maybeLoadSchemaInfo(StressSettings settings)
{
if (tableMetaData == null)
{
JavaDriverClient client = settings.getJavaDriverClient(keyspaceName);
synchronized (client)
{
if (tableMetaData != null)
return;
TableMetadata metadata = client.getCluster()
.getMetadata()
.getKeyspace(keyspaceName)
.getTable(quoteIdentifier(tableName));
if (metadata == null)
throw new RuntimeException("Unable to find table " + keyspaceName + "." + tableName);
//Fill in missing column configs
for (com.datastax.driver.core.ColumnMetadata col : metadata.getColumns())
{
if (columnConfigs.containsKey(col.getName()))
continue;
columnConfigs.put(col.getName(), new GeneratorConfig(seedStr + col.getName(), null, null, null));
}
tableMetaData = metadata;
}
}
}
public Set<TokenRange> maybeLoadTokenRanges(StressSettings settings)
{
maybeLoadSchemaInfo(settings); // ensure table metadata is availableView on GitHub (pinned to 88fd0f6a0e)