apache/cassandra · error · IllegalArgumentException

Unknown keyspace/table %s.%s

Error message

Unknown keyspace/table %s.%s

What it means

StandaloneVerifier.main checks early that the requested table exists: Schema.instance.getTableMetadata(options.keyspaceName, options.cfName) must be non-null, otherwise it throws IllegalArgumentException. Verification cannot run without the table definition.

Source

Thrown at src/java/org/apache/cassandra/tools/StandaloneVerifier.java:90

        Options options = Options.parseArgs(args);
        if (!options.force)
        {
            System.err.println("verify will not run without -f or --force. See CASSANDRA-17017 for details.");
            Options.printUsage(Options.getCmdLineOptions());
            System.exit(1);
        }
        initDatabaseDescriptorForTool();
        ClusterMetadataService.initializeForTools(false);
        System.out.println("sstableverify using the following options: " + options);

        List<SSTableReader> sstables = new ArrayList<>();
        int exitCode = 0;
        try
        {
            boolean hasFailed = false;

            if (Schema.instance.getTableMetadata(options.keyspaceName, options.cfName) == null)
                throw new IllegalArgumentException(String.format("Unknown keyspace/table %s.%s",
                                                                 options.keyspaceName,
                                                                 options.cfName));

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

            OutputHandler handler = new OutputHandler.SystemOutput(options.verbose, options.debug);
            Directories.SSTableLister lister = cfs.getDirectories().sstableLister(Directories.OnTxnErr.THROW).skipTemporary(true);

            // Verify sstables
            for (Map.Entry<Descriptor, Set<Component>> entry : lister.list().entrySet())
            {
                Set<Component> components = entry.getValue();
                if (!components.containsAll(entry.getKey().getFormat().primaryComponents()))
                    continue;

                try

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Verify the keyspace/table names with cqlsh and fix the arguments
  2. Ensure the tool runs where the schema for the table is present
  3. Recreate or restore the schema if the table was dropped

Example fix

// before
StandaloneVerifier ks1 ordes
// after
StandaloneVerifier ks1 orders
Defensive patterns

Strategy: validation

Validate before calling

if (Schema.instance.getTableMetadata(ks, cf) == null)
    throw new IllegalArgumentException("Unknown keyspace/table " + ks + "." + cf);

Try / catch

try { StandaloneVerifier.main(args); }
catch (IllegalArgumentException e) {
    if (e.getMessage().contains("Unknown keyspace/table")) {
        // fix the keyspace/table arguments
    } else throw e;
}

Prevention

When it happens

Trigger: Running the standalone verifier with a --keyspace/--table pair absent from the offline-loaded schema.

Common situations: Typo or case mistake in names; verifying sstables from another cluster where the table doesn't exist locally; table dropped before verification; missing schema files so lookup fails.

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