{"record":{"id":"d5747e04f7cb1e3c","repo":"apache/cassandra","slug":"cidr-group-s-doesn-t-exists","errorCode":null,"errorMessage":"CIDR group '%s' doesn't exists","messagePattern":"CIDR group '(.+?)' doesn't exists","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/auth/CIDRGroupsMappingManager.java","lineNumber":203,"sourceCode":"        process(query, CassandraAuthorizer.authWriteConsistencyLevel());\n    }\n\n    @VisibleForTesting\n    void dropCidrGroupIfExists(String cidrGroupName)\n    {\n        String query = String.format(\"DELETE FROM %s.%s WHERE cidr_group = '%s'\",\n                                     SchemaConstants.AUTH_KEYSPACE_NAME,\n                                     AuthKeyspace.CIDR_GROUPS,\n                                     cidrGroupName);\n\n        process(query, CassandraAuthorizer.authWriteConsistencyLevel());\n    }\n\n    public void dropCidrGroup(String cidrGroupName)\n    {\n        Set<String> cidrs = getCidrsOfCidrGroupAsStrings(cidrGroupName);\n        if (cidrs.isEmpty())\n            throw new RuntimeException(\"CIDR group '\" + cidrGroupName + \"' doesn't exists\");\n\n        dropCidrGroupIfExists(cidrGroupName);\n    }\n\n    public void recreateCidrGroupsMapping(Map<String, List<String>> cidrGroupsMapping)\n    {\n        Set<String> existingMappings = getAvailableCidrGroups();\n\n        // Overwrites mappings of existing cidr groups and inserts new cidr groups\n        for (Map.Entry<String, List<String>> cidrGroupMapping : cidrGroupsMapping.entrySet())\n        {\n            String cidrGroupName = cidrGroupMapping.getKey();\n            updateCidrGroup(cidrGroupName, cidrGroupMapping.getValue());\n            existingMappings.remove(cidrGroupName);\n        }\n\n        // Delete old CIDR groups which do not exist in new mappings\n        for (String cidrGroupName : existingMappings)","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/auth/CIDRGroupsMappingManager.java#L185-L221","documentation":"CIDRGroupsMappingManager.dropCidrGroup fetches the CIDR list for the given group name; if the group does not exist (empty set) it throws RuntimeException(\"CIDR group '<name>' doesn't exists\") instead of silently succeeding. The group must exist in the CIDR groups mapping table before it can be dropped.","triggerScenarios":"Calling dropCidrGroup with a name that has no entry in system_auth.cidr_groups (e.g. via CQLSH CIDR management commands or JMX), or after the group was already dropped.","commonSituations":"Scripts that drop CIDR groups unconditionally without checking existence; typos in group names; running DROP on a fresh cluster where no CIDR groups were created.","solutions":["Verify the group exists first (e.g. SELECT from system_auth.cidr_groups or use getCidrsOfCidrGroup) before dropping.","Use dropCidrGroupIfExists if idempotent behavior is desired.","Correct the CIDR group name typo."],"exampleFix":"// before\nmanager.dropCidrGroup(\"mygroup\"); // throws if missing\n// after\nif (!manager.getCidrsOfCidrGroupAsStrings(\"mygroup\").isEmpty())\n    manager.dropCidrGroup(\"mygroup\");\n","handlingStrategy":"validation","validationCode":"if (manager.getCidrsOfCidrGroupAsStrings(groupName).isEmpty()) { /* group missing; skip or create first */ }","typeGuard":null,"tryCatchPattern":"try { manager.dropCidrGroup(name); } catch (RuntimeException e) { if (e.getMessage().contains(\"doesn't exists\")) log.info(\"CIDR group already absent: \" + name); else throw e; }","preventionTips":["Make drop operations idempotent by checking existence first or using dropCidrGroupIfExists.","List existing CIDR groups before scripting drops.","Validate group names against the system_auth.cidr_groups content."],"tags":["auth","cidr","not-found","runtime-exception"],"backgroundTag":"entity-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"}