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
- Create the base table first, then the materialized view (order migrations correctly).
- Check the table name with 'DESCRIBE TABLES' / system_schema.tables and correct the FROM clause.
- 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
- Order migrations: keyspace, base tables, then views.
- Confirm base-table names with DESCRIBE TABLES before creating views.
- Avoid out-of-order or partial DDL deployments; use a migration tool with state tracking.
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
- 'Get CIDR groups for IP' operation not supported by %s
- category %s not found in %s
- Remote configuration of auth caches is disabled
- frozen<> is only allowed on collections, tuples, and user-de
- System keyspace '%s' is not user-modifiable
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/ba118148d25feb1d.
Report an issue: GitHub.