{"record":{"id":"938d9590dc891232","repo":"apache/cassandra","slug":"unknown-cache-name-cachename","errorCode":null,"errorMessage":"Unknown cache name: ${cacheName}","messagePattern":"Unknown cache name: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":771,"sourceCode":"        cacheService.invalidateRowCache();\n    }\n\n    public AuthCacheMBean getAuthCacheMBean(String cacheName)\n    {\n        switch (cacheName)\n        {\n            case PasswordAuthenticator.CredentialsCacheMBean.CACHE_NAME:\n                return ccProxy;\n            case AuthorizationProxy.JmxPermissionsCacheMBean.CACHE_NAME:\n                return jpcProxy;\n            case NetworkPermissionsCacheMBean.CACHE_NAME:\n                return npcProxy;\n            case PermissionsCacheMBean.CACHE_NAME:\n                return pcProxy;\n            case RolesCacheMBean.CACHE_NAME:\n                return rcProxy;\n            default:\n                throw new IllegalArgumentException(\"Unknown cache name: \" + cacheName);\n        }\n    }\n\n    public void drain() throws IOException, InterruptedException, ExecutionException\n    {\n        ssProxy.drain();\n    }\n\n    public Map<String, String> getTokenToEndpointMap(boolean withPort)\n    {\n        return withPort ? ssProxy.getTokenToEndpointWithPortMap() : ssProxy.getTokenToEndpointMap();\n    }\n\n    public List<String> getLiveNodes(boolean withPort)\n    {\n        return withPort ? ssProxy.getLiveNodesWithPort() : ssProxy.getLiveNodes();\n    }\n","sourceCodeStart":753,"sourceCodeEnd":789,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L753-L789","documentation":"NodeProbe.getCacheMetric (via the cache MBean switch) only recognizes KeyCache, RowCache, CounterCache, PermissionsCache and RolesCache. Any other cache name reaches the default branch and throws IllegalArgumentException.","triggerScenarios":"Calling nodetool cachecapacity/clear/disable/etc. (NodeProbe cache methods) with a cacheName string that is not one of the five known CACHE_NAME constants — typically a typo like 'keycache' or 'row_cache' instead of 'KeyCache'/'RowCache'.","commonSituations":"Typo in a script using lowercase names; referencing a cache removed in newer Cassandra versions; assuming a custom cache exists.","solutions":["Use an exact cache name: KeyCache, RowCache, CounterCache, PermissionsCache, or RolesCache","Fix case sensitivity in scripts (names are case-sensitive constants)","Check Cassandra version docs for which caches exist in your release"],"exampleFix":"// before\nnodetool setcachecapacity keycache 512\n// after\nnodetool setcachecapacity KeyCache 512","handlingStrategy":"validation","validationCode":"Set<String> valid = Set.of(\"KeyCache\",\"RowCache\",\"CounterCache\",\"PermissionsCache\",\"RolesCache\");\nif (!valid.contains(cacheName))\n    throw new IllegalArgumentException(\"Unknown cache name: \" + cacheName);","typeGuard":null,"tryCatchPattern":"try {\n    probe.setCacheCapacity(cacheName, capacityInMB);\n} catch (IllegalArgumentException e) {\n    System.err.println(\"Use one of: KeyCache, RowCache, CounterCache, PermissionsCache, RolesCache\");\n}","preventionTips":["Use exact case-sensitive cache names","Keep cache name constants in scripts sourced from the Cassandra docs for your version","Never assume custom caches exist in stock Cassandra"],"tags":["cli","invalid-argument","cache"],"backgroundTag":"invalid-enum-value","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"}