apache/cassandra · error · InvalidRequestException

ACCESS TO DATACENTERS operations not supported by AllowAllNe

Error message

ACCESS TO DATACENTERS operations not supported by AllowAllNetworkAuthorizer

What it means

Thrown by CreateViewStatement.apply when the base table referenced by the materialized view's SELECT does not exist in the resolved keyspace. The view depends on the base table, so creation is rejected before the view definition is added to the schema.

Source

Thrown at src/java/org/apache/cassandra/auth/AllowAllNetworkAuthorizer.java:35

 */

package org.apache.cassandra.auth;

import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.exceptions.InvalidRequestException;

public class AllowAllNetworkAuthorizer implements INetworkAuthorizer
{
    public void setup() {}

    public DCPermissions authorize(RoleResource role)
    {
        return DCPermissions.all();
    }

    public void setRoleDatacenters(RoleResource role, DCPermissions permissions)
    {
        throw new InvalidRequestException("ACCESS TO DATACENTERS operations not supported by AllowAllNetworkAuthorizer");
    }

    public void drop(RoleResource role) {}

    public void validateConfiguration() throws ConfigurationException {}

    @Override
    public boolean requireAuthorization()
    {
        return false;
    }
}

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Create the base table first, then the materialized view (order migrations correctly).
  2. Check the table name with 'DESCRIBE TABLES' / system_schema.tables and correct the FROM clause.
  3. Verify the fully-qualified table name and casing match the existing table.

Example fix

// before
CREATE MATERIALIZED VIEW ks.mv AS SELECT * FROM ks.base WHERE pk IS NOT NULL;
// after
CREATE TABLE ks.base (pk text PRIMARY KEY, v int);
CREATE MATERIALIZED VIEW ks.mv AS SELECT * FROM ks.base WHERE pk IS NOT NULL;
Defensive patterns

Strategy: validation

Validate before calling

if (session.execute("SELECT table_name FROM system_schema.tables WHERE keyspace_name = ? AND table_name = ?", ks, baseTable).one() == null)
    throw new IllegalStateException("Base table missing: " + ks + "." + baseTable);

Type guard

boolean tableExists(Session s, String ks, String table) {
    return s.execute("SELECT table_name FROM system_schema.tables WHERE keyspace_name = ? AND table_name = ?", ks, table).one() != null;
}

Try / catch

try {
    session.execute(createMvStmt);
} catch (InvalidQueryException e) {
    if (e.getMessage().contains("Base table") && e.getMessage().contains("doesn't exist")) { createBaseTable(); retry(createMvStmt); }
    else throw e;
}

Prevention

When it happens

Trigger: Executing 'CREATE MATERIALIZED VIEW ks.mv AS SELECT ... FROM ks.base WHERE ...' where ks.base is missing, dropped, or named with different casing than the actual table.

Common situations: Typos in the table name; DDL scripts run out of order (view created before the base table); base table dropped by another client; running against an environment where the table was never created.

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