apache/cassandra · warning · IllegalStateException

The node does not have

Error message

The node does not have {keyspace} yet, probably still bootstrapping. Effective ownership information is meaningless.

What it means

When resolving the effective-ownership keyspace via the Keyspace instance (Schema.instance.getKeyspaceInstance), a null instance means this node has not loaded the keyspace's schema/data yet - typically because the node is still bootstrapping. Ownership math would be meaningless, so an IllegalStateException is thrown.

Solutions

  1. Wait until bootstrap completes ('Node ... state jump to normal') and retry
  2. Retry after schema agreement is reached (`nodetool describecluster` / schema versions match)
  3. Ensure the keyspace's replication actually targets this node's datacenter
  4. Run the ownership query from an established, joined node

Example fix

// before: query during bootstrap -> fails
nodetool ownership my_ks
// after: wait for join, then query
nodetool netstats  # confirm bootstrap done
nodetool ownership my_ks
Defensive patterns

Strategy: retry

Validate before calling

StorageServiceMBean ss = ...;
if (!ss.getOperationMode().equals("NORMAL")) throw new IllegalStateException("node still bootstrapping; retry later");
// plus: confirm schema contains the keyspace before querying

Try / catch

try { ss.effectiveOwnership(ks); } catch (IllegalStateException e) { if (e.getMessage().contains("still bootstrapping")) { awaitOperationModeNormal(timeout); return ss.effectiveOwnership(ks); } throw e; }

Prevention

When it happens

Trigger: Calling describeOwnership/effectiveOwnership (e.g. `nodetool ownership`) on a node that is still bootstrapping or hasn't received the keyspace's schema yet.

Common situations: Running ownership checks on a freshly added node mid-bootstrap; new DC build where the keyspace isn't replicated to that DC yet; schema propagation delay after keyspace creation.

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

Appendix: source

Thrown at src/java/org/apache/cassandra/service/StorageService.java:4293

            if (userKeyspaces.size() > 0)
            {
                keyspace = userKeyspaces.iterator().next();
                AbstractReplicationStrategy replicationStrategy = Schema.instance.getKeyspaceInstance(keyspace).getReplicationStrategy();
                for (String keyspaceName : userKeyspaces)
                {
                    if (!Schema.instance.getKeyspaceInstance(keyspaceName).getReplicationStrategy().hasSameSettings(replicationStrategy))
                        throw new IllegalStateException("Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless");
                }
            }

            if (keyspace == null)
            {
                keyspace = "system_traces";
            }

            Keyspace keyspaceInstance = Schema.instance.getKeyspaceInstance(keyspace);
            if (keyspaceInstance == null)
                throw new IllegalStateException("The node does not have " + keyspace + " yet, probably still bootstrapping. Effective ownership information is meaningless.");
            replicationParams = keyspaceInstance.getMetadata().params.replication;
            strategy = keyspaceInstance.getReplicationStrategy();
        }

        if (replicationParams.isMeta())
        {
            LinkedHashMap<InetAddressAndPort, Float> ownership = Maps.newLinkedHashMap();
            metadata.placement(replicationParams).writes.byEndpoint().flattenValues().forEach((r) -> {
                ownership.put(r.endpoint(), 1.0f);
            });
            return ownership;
        }

        Collection<Collection<InetAddressAndPort>> endpointsGroupedByDc = new ArrayList<>();
        // mapping of dc's to nodes, use sorted map so that we get dcs sorted
        SortedMap<String, Collection<InetAddressAndPort>> sortedDcsToEndpoints = new TreeMap<>(ClusterMetadata.current().directory.allDatacenterEndpoints().asMap());
        for (Collection<InetAddressAndPort> endpoints : sortedDcsToEndpoints.values())
            endpointsGroupedByDc.add(endpoints);

View on GitHub (pinned to 88fd0f6a0e)