{"record":{"id":"42d867c6596ab019","repo":"apache/pulsar","slug":"topic-s-namespace-does-not-exist-42d867","errorCode":null,"errorMessage":"Topic's namespace does not exist","messagePattern":"Topic's namespace does not exist","errorType":"http","errorClass":"RestException","httpStatus":404,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java","lineNumber":251,"sourceCode":"        AuthorizationService authService = pulsar().getBrokerService().getAuthorizationService();\n        if (null != authService) {\n            return authService.grantPermissionAsync(topicUri, actions, role, null/*additional auth-data json*/)\n                    .thenAccept(__ -> log.info()\n                            .attr(\"role\", role)\n                            .attr(\"actions\", actions)\n                            .attr(\"topic\", topicUri)\n                            .log(\"Successfully granted access for role on topic\"))\n                    .exceptionally(ex -> {\n                        Throwable realCause = FutureUtil.unwrapCompletionException(ex);\n                        //The IllegalArgumentException and the IllegalStateException were historically thrown by the\n                        // grantPermissionAsync method, so we catch them here to ensure backwards compatibility.\n                        if (realCause instanceof MetadataStoreException.NotFoundException\n                                || realCause instanceof IllegalArgumentException) {\n                            log.warn()\n                                    .attr(\"topic\", topicUri)\n                                    .exception(realCause)\n                                    .log(\"Failed to set permissions for topic: Namespace does not exist\");\n                            throw new RestException(Status.NOT_FOUND, \"Topic's namespace does not exist\");\n                        } else if (realCause instanceof MetadataStoreException.BadVersionException\n                                || realCause instanceof IllegalStateException) {\n                            log.warn()\n                                    .attr(\"topic\", topicUri)\n                                    .exceptionMessage(realCause)\n                                    .log(\"Failed to set permissions for topic\");\n                            throw new RestException(Status.CONFLICT, \"Concurrent modification\");\n                        } else {\n                            log.error()\n                                    .attr(\"topic\", topicUri)\n                                    .exceptionMessage(realCause)\n                                    .log(\"Failed to get permissions for topic\");\n                            throw new RestException(realCause);\n                        }\n                    });\n        } else {\n            String msg = \"Authorization is not enabled\";\n            return FutureUtil.failedFuture(new RestException(Status.NOT_IMPLEMENTED, msg));","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java#L233-L269","documentation":"During grantPermissionsAsync on a topic, namespace-existence validation failed: the topic's namespace does not exist (never created or deleted), so permission granting cannot continue and a 404 is surfaced.","triggerScenarios":"Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:251 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the namespace exists and retry the grant","Fix the topic URI tenant/namespace segments"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}