apache/cassandra · error · InvalidRequestException

No such keyspace:

Error message

No such keyspace: 

What it means

Thrown by StorageService.describeRing when the requested keyspace does not exist in the local schema. The ring-description API (used by nodetool describering and JMX) requires an existing keyspace to compute token ranges for, and throws InvalidRequestException for unknown names.

Source

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

    /**
     * The TokenRange for a given keyspace.
     *
     * @param keyspace The keyspace to fetch information about
     *
     * @return a List of TokenRange(s) for the given keyspace
     *
     * @throws InvalidRequestException if there is no ring information available about keyspace
     */
    public List<TokenRange> describeRing(String keyspace) throws InvalidRequestException
    {
        return describeRing(keyspace, false, false);
    }

    private List<TokenRange> describeRing(String keyspace, boolean includeOnlyLocalDC, boolean withPort) throws InvalidRequestException
    {
        if (!Schema.instance.getKeyspaces().contains(keyspace))
            throw new InvalidRequestException("No such keyspace: " + keyspace);

        if (keyspace == null || Keyspace.open(keyspace).getReplicationStrategy() instanceof LocalStrategy)
            throw new InvalidRequestException("There is no ring for the keyspace: " + keyspace);

        List<TokenRange> ranges = new ArrayList<>();
        Token.TokenFactory tf = getTokenFactory();

        EndpointsByRange rangeToAddressMap =
                includeOnlyLocalDC
                        ? getRangeToAddressMapInLocalDC(keyspace)
                        : getRangeToAddressMap(keyspace);

        for (Map.Entry<Range<Token>, EndpointsForRange> entry : rangeToAddressMap.entrySet())
            ranges.add(TokenRange.create(tf, entry.getKey(), ImmutableList.copyOf(entry.getValue().endpoints()), withPort));

        return ranges;
    }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. List existing keyspaces (`nodetool describecluster`, cqlsh DESCRIBE KEYSPACES) and correct the name
  2. Check case sensitivity - quoted keyspace names are case-sensitive
  3. Run `nodetool tpstats`/schema agreement check; wait for schema to agree if the keyspace was just created
  4. Verify you are querying the intended cluster

Example fix

// before
nodetool describering KeySpace1   # typo / dropped
// after
cqlsh -e 'DESCRIBE KEYSPACES;'
nodetool describering keyspace1   # exact existing name
Defensive patterns

Strategy: validation

Validate before calling

// Verify keyspace exists before describering
List<String> keyspaces = /* from cqlsh DESCRIBE KEYSPACES or Schema proxy */;
if (!keyspaces.contains(keyspace)) throw new IllegalArgumentException("No such keyspace: " + keyspace);

Try / catch

try {
    String ring = ssProxy.describeRing(keyspace);
} catch (InvalidRequestException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("No such keyspace"))
        log.warn("Keyspace {} missing - check name/case and schema agreement", keyspace);
    else throw e;
}

Prevention

When it happens

Trigger: Calling `nodetool describering <keyspace>` or the JMX describeRing method with a misspelled or dropped keyspace; calling before schema is fully propagated to the node.

Common situations: Typo in keyspace name (case sensitivity with quoted identifiers); keyspace dropped concurrently; schema disagreement - the node hasn't yet received the keyspace's schema; tooling using an old config value.

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