{"record":{"id":"be5c3ca8820f04dc","repo":"apache/cassandra","slug":"partition-denylist-table-metadata-not-found","errorCode":null,"errorMessage":"Partition denylist table metadata not found","messagePattern":"Partition denylist table metadata not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/schema/PartitionDenylist.java","lineNumber":174,"sourceCode":"        {\n            logger.error(\"Failed to load partition denylist\", tr);\n            retryReason = \"Exception\";\n        }\n\n        // This path will also be taken on other failures other than UnavailableException,\n        // but seems like a good idea to retry anyway.\n        int retryInSeconds = DatabaseDescriptor.getDenylistInitialLoadRetrySeconds();\n        logger.info(\"{} while loading partition denylist cache. Scheduled retry in {} seconds.\", retryReason, retryInSeconds);\n        ScheduledExecutors.optionalTasks.schedule(this::initialLoad, retryInSeconds, TimeUnit.SECONDS);\n    }\n\n    private boolean checkDenylistNodeAvailability()\n    {\n        TableMetadata denyListTable = ClusterMetadata.current().schema.getKeyspaceMetadata(SystemDistributedKeyspace.NAME)\n                                                              .getTableOrViewNullable(SystemDistributedKeyspace.PARTITION_DENYLIST_TABLE);\n        if (denyListTable == null)\n        {\n            logger.warn(\"Partition denylist table metadata not found\");\n            return false;\n        }\n\n        boolean sufficientNodes = RangeCommands.sufficientLiveNodesForSelectStar(denyListTable, DatabaseDescriptor.getDenylistConsistencyLevel());\n        if (!sufficientNodes)\n        {\n            AVAILABILITY_LOGGER.warn(\"Attempting to load denylist and not enough nodes are available for a {} refresh. Reload the denylist when unavailable nodes are recovered to ensure your denylist remains in sync.\",\n                                     DatabaseDescriptor.getDenylistConsistencyLevel());\n        }\n        return sufficientNodes;\n    }\n\n    /** Helper method as we need to both build cache on initial init but also on reload of cache contents and params */\n    private LoadingCache<TableId, DenylistEntry> buildEmptyCache()\n    {\n        // We rely on details of .refreshAfterWrite to reload this async in the background when it's hit:\n        // https://github.com/ben-manes/caffeine/wiki/Refresh\n        return Caffeine.newBuilder()","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/schema/PartitionDenylist.java#L156-L192","documentation":"PartitionDenylist.checkDenylistNodeAvailability logs this warning when the partition_denylist table metadata is missing from the system_distributed keyspace. The method returns false, so denylist loads/refreshes are skipped rather than failing.","triggerScenarios":"Any denylist operation (initialLoad, load, reload, getDenylistForAllTablesFromCQL, refreshTableDenylist) when ClusterMetadata schema lacks the PARTITION_DENYLIST_TABLE — typically before upgrade/migration created it.","commonSituations":"Upgraded clusters where the denylist table creation did not run; schema disagreement preventing the table from propagating; nodes started before schema fully synced.","solutions":["Ensure schema is fully agreed cluster-wide (nodetool describecluster) and the denylist migration/table creation has executed","Manually verify the table exists: DESCRIBE TABLE system_distributed.partition_denylist; create per upgrade instructions if absent","Restart the node after schema converges so ClusterMetadata reloads the table","Check for schema pull failures in logs (schema disagreement during rolling upgrade)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check table exists before denylist ops\nboolean denylistTableReady =\n    ClusterMetadata.current().schema.getKeyspaceMetadata(SystemDistributedKeyspace.NAME) != null &&\n    ClusterMetadata.current().schema.getKeyspaceMetadata(SystemDistributedKeyspace.NAME)\n        .getTableOrViewNullable(SystemDistributedKeyspace.PARTITION_DENYLIST_TABLE) != null;","typeGuard":"boolean denylistTablePresent(KeyspaceMetadata ks) {\n    return ks != null && ks.getTableOrViewNullable(SystemDistributedKeyspace.PARTITION_DENYLIST_TABLE) != null;\n}","tryCatchPattern":"if (!denylistTablePresent(...)) { skipDenylistLoad(); return; } // matching built-in fallback","preventionTips":["Confirm denylist migration ran after upgrade (table exists in system_distributed)","Ensure schema agreement cluster-wide before using denylist features","Reload schema/restart node if metadata appears stale"],"tags":["denylist","schema","system-distributed","availability"],"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-14T21:17:11.552Z"}