{"record":{"id":"ba118148d25feb1d","repo":"apache/cassandra","slug":"access-to-datacenters-operations-not-supported-by","errorCode":null,"errorMessage":"ACCESS TO DATACENTERS operations not supported by AllowAllNetworkAuthorizer","messagePattern":"ACCESS TO DATACENTERS operations not supported by AllowAllNetworkAuthorizer","errorType":"exception","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/auth/AllowAllNetworkAuthorizer.java","lineNumber":35,"sourceCode":" */\n\npackage org.apache.cassandra.auth;\n\nimport org.apache.cassandra.exceptions.ConfigurationException;\nimport org.apache.cassandra.exceptions.InvalidRequestException;\n\npublic class AllowAllNetworkAuthorizer implements INetworkAuthorizer\n{\n    public void setup() {}\n\n    public DCPermissions authorize(RoleResource role)\n    {\n        return DCPermissions.all();\n    }\n\n    public void setRoleDatacenters(RoleResource role, DCPermissions permissions)\n    {\n        throw new InvalidRequestException(\"ACCESS TO DATACENTERS operations not supported by AllowAllNetworkAuthorizer\");\n    }\n\n    public void drop(RoleResource role) {}\n\n    public void validateConfiguration() throws ConfigurationException {}\n\n    @Override\n    public boolean requireAuthorization()\n    {\n        return false;\n    }\n}\n","sourceCodeStart":17,"sourceCodeEnd":48,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/auth/AllowAllNetworkAuthorizer.java#L17-L48","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nCREATE MATERIALIZED VIEW ks.mv AS SELECT * FROM ks.base WHERE pk IS NOT NULL;\n// after\nCREATE TABLE ks.base (pk text PRIMARY KEY, v int);\nCREATE MATERIALIZED VIEW ks.mv AS SELECT * FROM ks.base WHERE pk IS NOT NULL;","handlingStrategy":"validation","validationCode":"if (session.execute(\"SELECT table_name FROM system_schema.tables WHERE keyspace_name = ? AND table_name = ?\", ks, baseTable).one() == null)\n    throw new IllegalStateException(\"Base table missing: \" + ks + \".\" + baseTable);","typeGuard":"boolean tableExists(Session s, String ks, String table) {\n    return s.execute(\"SELECT table_name FROM system_schema.tables WHERE keyspace_name = ? AND table_name = ?\", ks, table).one() != null;\n}","tryCatchPattern":"try {\n    session.execute(createMvStmt);\n} catch (InvalidQueryException e) {\n    if (e.getMessage().contains(\"Base table\") && e.getMessage().contains(\"doesn't exist\")) { createBaseTable(); retry(createMvStmt); }\n    else throw e;\n}","preventionTips":["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."],"tags":["cassandra","cql","materialized-view","ddl","schema"],"backgroundTag":"resource-not-found","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}