apache/cassandra · error · IllegalArgumentException

Unknown keyspace/table %s.%s

Error message

Unknown keyspace/table %s.%s

What it means

SSTableOfflineRelevel validates its keyspace/table arguments against the loaded Schema before doing offline releveling. If Schema.instance.getTableMetadata returns null, the pair does not exist on this node and an IllegalArgumentException naming the keyspace and table is thrown.

Source

Thrown at src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java:98

     */
    public static void main(String[] args) throws IOException
    {
        PrintStream out = System.out;
        if (args.length < 2)
        {
            out.println("This command should be run with Cassandra stopped!");
            out.println("Usage: sstableofflinerelevel [--dry-run] <keyspace> <columnfamily>");
            System.exit(1);
        }

        Util.initDatabaseDescriptor();
        ClusterMetadataService.initializeForTools(false);
        boolean dryRun = args[0].equals("--dry-run");
        String keyspace = args[args.length - 2];
        String columnfamily = args[args.length - 1];

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

        // remove any leftovers in the transaction log
        Keyspace ks = Keyspace.openWithoutSSTables(keyspace);
        ColumnFamilyStore cfs = ks.getColumnFamilyStore(columnfamily);
        if (!LifecycleTransaction.removeUnfinishedLeftovers(cfs))
        {
            throw new RuntimeException(String.format("Cannot remove temporary or obsoleted files for %s.%s " +
                                                     "due to a problem with transaction log files.",
                                                     keyspace, columnfamily));
        }

        Directories.SSTableLister lister = cfs.getDirectories().sstableLister(Directories.OnTxnErr.THROW).skipTemporary(true);
        SetMultimap<File, SSTableReader> sstableMultimap = HashMultimap.create();
        for (Map.Entry<Descriptor, Set<Component>> sstable : lister.list().entrySet())
        {
            if (sstable.getKey() != null)

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Verify the exact keyspace and table names (lowercase unless quoted at creation) and re-run
  2. Confirm the table exists in the schema of the data directory being processed (check schema tables or system.log)
  3. Use tabular listing of the data directory to find the actual keyspace/table directories

Example fix

// before
sstableofflinerelevel Keyspace1 Users
// after (CQL identifiers are lowercase by default)
sstableofflinerelevel keyspace1 users
Defensive patterns

Strategy: validation

Validate before calling

// verify identifiers exist before invoking
cqlsh -e "DESCRIBE KEYSPACE keyspace1" || exit 1
cqlsh -e "DESCRIBE TABLE keyspace1.users" || exit 1

Try / catch

try { SSTableOfflineRelevel.main(args); }
catch (IllegalArgumentException e) { System.err.println("Bad table: " + e.getMessage()); }

Prevention

When it happens

Trigger: Running `sstableofflinerelevel [--dry-run] <keyspace> <table>` with a misspelled keyspace or table, or on a node that does not hold that schema (schema not present in the copied data directory).

Common situations: Typo'd keyspace/table names; running the tool against a data dir snapshot taken before the table was created; case-sensitivity mistakes (unquoted identifiers are lowercased in CQL); dropping the table earlier but leftover SSTables remain.

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