apache/cassandra · error · java.lang.IllegalArgumentException

Unknown tables: " + verifier.get(ks) + " in keyspace: " + ks

Error message

Unknown tables: " + verifier.get(ks) + " in keyspace: " + ks

What it means

OptionFilter.verifyTables checks that every table name given to nodetool tablestats exists within its specified keyspace. Any table names that were requested but not found under the filter's keyspace are reported in an IllegalArgumentException. This prevents silently returning empty/partial stats for misnamed tables.

Solutions

  1. List the actual tables with `nodetool tables <keyspace>` or query system_schema.tables and use exact names
  2. Re-run with corrected table names
  3. Omit table arguments to gather stats for every table in the keyspace

Example fix

// before
nodetool tablestats my_ks.user_tabel
// after
nodetool tablestats my_ks.users
Defensive patterns

Strategy: validation

Validate before calling

Set<String> tables = session.execute("SELECT table_name FROM system_schema.tables WHERE keyspace_name = ?", ks).all().stream().map(r -> r.getString(0)).collect(Collectors.toSet());
if (!tables.contains(table)) throw new IllegalArgumentException("Unknown table: " + table);

Try / catch

try { runNodetool(args); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Unknown tables:")) { /* list system_schema.tables for the keyspace */ } else throw e; }

Prevention

When it happens

Trigger: `nodetool tablestats ks1.table1 ks1.bogus_table` where bogus_table does not exist in ks1; or supplying a table with no keyspace qualifier that matches no table.

Common situations: Typos in table names; renamed or dropped tables; confusion between table name and the underlying SSTable file name; case-sensitivity mistakes.

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


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

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsHolder.java:650

            // Note that if there is any table for the keyspace, we want to include the keyspace irregarding
            // of the ignoreMode, since the ignoreMode then apply to the table inside the keyspace but the
            // keyspace itself is not ignored
            return filter.get(keyspace) != null || ignoreMode;
        }

        public void verifyKeyspaces(Collection<String> keyspaces)
        {
            for (String ks : verifier.keySet())
                if (!keyspaces.contains(ks))
                    throw new IllegalArgumentException("Unknown keyspace: " + ks);
        }

        public void verifyTables()
        {
            for (String ks : filter.keySet())
                if (!verifier.get(ks).isEmpty())
                    throw new IllegalArgumentException("Unknown tables: " + verifier.get(ks) + " in keyspace: " + ks);
        }
    }
}

View on GitHub (pinned to 88fd0f6a0e)