apache/cassandra · error · IllegalArgumentException

Unknown table .

Error message

Unknown table %s.%s

What it means

When translating a list of keyspaces/tables into TableIds for a consensus-migration operation, each requested table name is resolved against the schema in ClusterMetadata. If a named table does not exist in the given keyspace, Cassandra throws this IllegalArgumentException.

Solutions

  1. Verify the table exists: SELECT table_name FROM system_schema.tables WHERE keyspace_name = '<ks>'; and fix the name/casing in the command
  2. Quote case-sensitive identifiers correctly in CQL
  3. Re-run the migration with the corrected keyspace/table list
  4. If the table was dropped intentionally, remove it from the migration table list
Defensive patterns

Strategy: validation

Validate before calling

List<String> existing = session.execute("SELECT table_name FROM system_schema.tables WHERE keyspace_name=?", ks)
    .all().stream().map(r -> r.getString("table_name")).collect(toList());
if (!existing.containsAll(tableNames)) throw new IllegalArgumentException("unknown table(s) requested");

Try / catch

try { migrate(ks, tables); } catch (IllegalArgumentException e) { /* correct table names/casing and retry */ }

Prevention

When it happens

Trigger: Calling tableIdsToMigrate/migration APIs (or the operator command that wraps them) with an explicit table list containing a table name that does not exist in the specified keyspace — e.g. typo in table name, table dropped, or wrong keyspace casing.

Common situations: Typo'd or case-sensitive table name in the migration command; table dropped between planning and execution; copying a command between clusters/environments where the table set differs; keyspace named without quoting a case-sensitive identifier.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/4633eb642fe24cb9. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/service/consensus/migration/ConsensusTableMigration.java:357


    private static List<TableId> keyspacesAndTablesToTableIds(@Nonnull ClusterMetadata cm, @Nonnull List<String> keyspaceNames, @Nonnull Optional<List<String>> maybeTables)
    {
        return keyspacesAndTablesToTableIds(cm, keyspaceNames, maybeTables, Optional.empty());
    }

    private static List<TableId> keyspacesAndTablesToTableIds(@Nonnull ClusterMetadata cm, @Nonnull List<String> keyspaceNames, @Nonnull Optional<List<String>> maybeTables, @Nonnull Optional<Predicate<TableId>> includeTable)
    {
        List<TableId> tableIds = new ArrayList<>();
        for (String keyspaceName : keyspaceNames)
        {
            Optional<Collection<TableId>> maybeTableIds = maybeTables.map(tableNames ->
                    tableNames
                            .stream()
                            .map(tableName -> {
                                TableMetadata tm = cm.schema.getTableMetadata(keyspaceName, tableName);
                                if (tm == null)
                                    throw new IllegalArgumentException(format("Unknown table %s.%s", keyspaceName, tableName));
                                return tm.id;
                            })
                            .collect(toImmutableList()));
            tableIds.addAll(
                    maybeTableIds.orElseGet(() ->
                            cm.schema.getKeyspace(keyspaceName).getColumnFamilyStores()
                                    .stream()
                                    .map(ColumnFamilyStore::getTableId)
                                    .filter(includeTable.orElse(Predicates.alwaysTrue())) // Filter out non-migrating so they don't generate an error
                                    .collect(toImmutableList())));
        }
        return tableIds;
    }

    @Nonnull
    private static RepairOption getRepairOption(Collection<TableMigrationState> tables, List<Range<Token>> intersectingRanges, boolean repairData, boolean repairPaxos, boolean repairAccord)
    {
        boolean primaryRange = false;

View on GitHub (pinned to 88fd0f6a0e)