apache/cassandra · error · IllegalArgumentException

Unknown table %s.%s

Error message

Unknown table %s.%s

What it means

StandaloneScrubber.main, after validating the keyspace, iterates the keyspace's valid column families looking for the requested table. If no ColumnFamilyStore matches options.cfName, cfs stays null and it throws IllegalArgumentException for an unknown table.

Source

Thrown at src/java/org/apache/cassandra/tools/StandaloneScrubber.java:113

        {
            if (Schema.instance.getKeyspaceMetadata(options.keyspaceName) == null)
                throw new IllegalArgumentException(String.format("Unknown keyspace %s", options.keyspaceName));

            // Do not load sstables since they might be broken
            Keyspace keyspace = Keyspace.openWithoutSSTables(options.keyspaceName);

            ColumnFamilyStore cfs = null;
            for (ColumnFamilyStore c : keyspace.getValidColumnFamilies(true, false, options.cfName))
            {
                if (c.name.equals(options.cfName))
                {
                    cfs = c;
                    break;
                }
            }

            if (cfs == null)
                throw new IllegalArgumentException(String.format("Unknown table %s.%s",
                                                                  options.keyspaceName,
                                                                  options.cfName));

            String snapshotName = "pre-scrub-" + currentTimeMillis();

            OutputHandler handler = new OutputHandler.SystemOutput(options.verbose, options.debug);
            Directories.SSTableLister lister = cfs.getDirectories().sstableLister(Directories.OnTxnErr.THROW).skipTemporary(true);
            List<Pair<Descriptor, Set<Component>>> listResult = new ArrayList<>();

            // create snapshot
            for (Map.Entry<Descriptor, Set<Component>> entry : lister.list().entrySet())
            {
                Descriptor descriptor = entry.getKey();
                Set<Component> components = entry.getValue();
                if (!components.contains(Components.DATA))
                    continue;

                listResult.add(Pair.create(descriptor, components));

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. List tables in the keyspace (DESCRIBE tables in cqlsh) and correct the table name
  2. Use the exact lowercased name for unquoted identifiers
  3. Ensure the table still exists in the schema used by the tool

Example fix

// before
StandaloneScrubber ks1 Usres
// after
StandaloneScrubber ks1 users
Defensive patterns

Strategy: validation

Validate before calling

ColumnFamilyStore cfs = Schema.instance.getTableMetadata(ks, cf) != null
    ? Keyspace.openWithoutSSTables(ks).getColumnFamilyStore(cf) : null;
if (cfs == null) throw new IllegalArgumentException("Unknown table " + ks + "." + cf);

Try / catch

try { StandaloneScrubber.main(args); }
catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unknown table ")) {
        // fix the table name argument
    } else throw e;
}

Prevention

When it happens

Trigger: Running the standalone scrubber with a keyspace that exists but a --cf/--table name that does not match any table in that keyspace.

Common situations: Typo in the table name; case mismatch (unquoted names are lowercase); table renamed or dropped; passing a secondary-index or view name where a base table is expected.

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/b6cd09b3e418521a. Report an issue: GitHub.