{"record":{"id":"00b924c3cc54bc3a","repo":"apache/cassandra","slug":"s-doesn-t-exist-00b924","errorCode":null,"errorMessage":"%s doesn't exist","messagePattern":"(.+?) doesn't exist","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/ListPermissionsStatement.java","lineNumber":112,"sourceCode":"    }\n\n    // TODO: Create a new ResultMessage type (?). Rows will do for now.\n    public ResultMessage execute(ClientState state) throws RequestValidationException, RequestExecutionException\n    {\n        List<PermissionDetails> details = new ArrayList<>();\n\n        if (resource != null && recursive)\n        {\n            for (IResource r : Resources.chain(resource))\n                details.addAll(list(state, r));\n        }\n        else\n        {\n            details.addAll(list(state, resource));\n        }\n\n        if (resource != null && !resource.exists())\n            throw new InvalidRequestException(String.format(\"%s doesn't exist\", resource));\n\n        if ((grantee != null) && !DatabaseDescriptor.getRoleManager().isExistingRole(grantee))\n            throw new InvalidRequestException(String.format(\"%s doesn't exist\", grantee));\n\n        Collections.sort(details);\n        return resultMessage(details);\n    }\n\n    private Set<PermissionDetails> list(ClientState state, IResource resource)\n    throws RequestValidationException, RequestExecutionException\n    {\n        try\n        {\n            return DatabaseDescriptor.getAuthorizer().list(state.getUser(), permissions, resource, grantee);\n        }\n        catch (UnsupportedOperationException e)\n        {\n            throw new InvalidRequestException(e.getMessage());","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/ListPermissionsStatement.java#L94-L130","documentation":"LIST PERMISSIONS with an explicit resource throws InvalidRequestException when that resource does not exist (e.g. a keyspace/table that was dropped or never created). IResource.exists() is checked in execute() before results are returned.","triggerScenarios":"Executing LIST ALL PERMISSIONS ON KEYSPACE <ks> (or ON <table> / role resource) where resource.exists() returns false — the keyspace/table was dropped or never created.","commonSituations":"Auditing permissions after a keyspace was dropped; typo in keyspace/table name; scripts written against a different environment.","solutions":["Verify the resource exists: DESCRIBE KEYSPACES / DESCRIBE TABLES, then correct the name","Recreate the resource if it should exist","Run LIST ALL PERMISSIONS without the ON clause to list permissions across all existing resources"],"exampleFix":"// before\nLIST ALL PERMISSIONS ON KEYSPACE sales_old; // dropped\n// after\nLIST ALL PERMISSIONS ON KEYSPACE sales;","handlingStrategy":"validation","validationCode":"KeyspaceMetadata ks = session.getCluster().getMetadata().getKeyspace(ksName);\nif (ks == null) throw new IllegalArgumentException(\"keyspace \" + ksName + \" doesn't exist; skip LIST PERMISSIONS ON\");","typeGuard":null,"tryCatchPattern":"try { session.execute(\"LIST ALL PERMISSIONS ON KEYSPACE \" + ks); } catch (InvalidRequestException e) { if (e.getMessage().endsWith(\"doesn't exist\")) log.warn(\"resource vanished: {}\", ks); else throw e; }","preventionTips":["Resolve resources via cluster metadata before auditing permissions","Handle dropped keyspaces in audit scripts (skip, don't fail)","Confirm environment (dev/prod) before running resource-scoped LIST PERMISSIONS"],"tags":["cassandra","cql","permissions","resource","invalid-request"],"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"}