apache/cassandra · error · InvalidRequestException

%s doesn't exist

Error message

%s doesn't exist

What it means

LIST PERMISSIONS with an explicit resource throws InvalidRequestException when that resource does not exist (e.g. a keyspace/table that was dropped or never created). IResource.exists() is checked in execute() before results are returned.

Source

Thrown at src/java/org/apache/cassandra/cql3/statements/ListPermissionsStatement.java:112

    }

    // TODO: Create a new ResultMessage type (?). Rows will do for now.
    public ResultMessage execute(ClientState state) throws RequestValidationException, RequestExecutionException
    {
        List<PermissionDetails> details = new ArrayList<>();

        if (resource != null && recursive)
        {
            for (IResource r : Resources.chain(resource))
                details.addAll(list(state, r));
        }
        else
        {
            details.addAll(list(state, resource));
        }

        if (resource != null && !resource.exists())
            throw new InvalidRequestException(String.format("%s doesn't exist", resource));

        if ((grantee != null) && !DatabaseDescriptor.getRoleManager().isExistingRole(grantee))
            throw new InvalidRequestException(String.format("%s doesn't exist", grantee));

        Collections.sort(details);
        return resultMessage(details);
    }

    private Set<PermissionDetails> list(ClientState state, IResource resource)
    throws RequestValidationException, RequestExecutionException
    {
        try
        {
            return DatabaseDescriptor.getAuthorizer().list(state.getUser(), permissions, resource, grantee);
        }
        catch (UnsupportedOperationException e)
        {
            throw new InvalidRequestException(e.getMessage());

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Verify the resource exists: DESCRIBE KEYSPACES / DESCRIBE TABLES, then correct the name
  2. Recreate the resource if it should exist
  3. Run LIST ALL PERMISSIONS without the ON clause to list permissions across all existing resources

Example fix

// before
LIST ALL PERMISSIONS ON KEYSPACE sales_old; // dropped
// after
LIST ALL PERMISSIONS ON KEYSPACE sales;
Defensive patterns

Strategy: validation

Validate before calling

KeyspaceMetadata ks = session.getCluster().getMetadata().getKeyspace(ksName);
if (ks == null) throw new IllegalArgumentException("keyspace " + ksName + " doesn't exist; skip LIST PERMISSIONS ON");

Try / catch

try { session.execute("LIST ALL PERMISSIONS ON KEYSPACE " + ks); } catch (InvalidRequestException e) { if (e.getMessage().endsWith("doesn't exist")) log.warn("resource vanished: {}", ks); else throw e; }

Prevention

When it happens

Trigger: Executing LIST ALL PERMISSIONS ON KEYSPACE <ks> (or ON <table> / role resource) where resource.exists() returns false — the keyspace/table was dropped or never created.

Common situations: Auditing permissions after a keyspace was dropped; typo in keyspace/table name; scripts written against a different environment.

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