{"record":{"id":"8cb335185308f911","repo":"apache/pulsar","slug":"namespace-does-not-exist-8cb335","errorCode":null,"errorMessage":"Namespace does not exist","messagePattern":"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":174,"sourceCode":"import org.jspecify.annotations.Nullable;\n\n/**\n */\npublic class PersistentTopicsBase extends AdminResource {\n    private static final io.github.merlimat.slog.Logger LOG =\n            io.github.merlimat.slog.Logger.get(PersistentTopicsBase.class);\n\n    private static final int OFFLINE_TOPIC_STAT_TTL_MINS = 10;\n    private static final String DEPRECATED_CLIENT_VERSION_PREFIX = \"Pulsar-CPP-v\";\n    private static final Version LEAST_SUPPORTED_CLIENT_VERSION_PREFIX = Version.forIntegers(1, 21);\n\n    protected CompletableFuture<List<String>> internalGetListAsync(Optional<String> bundle,\n                                                                   @Nullable Map<String, String> properties) {\n        return validateNamespaceOperationAsync(namespaceName, NamespaceOperation.GET_TOPICS)\n            .thenCompose(__ -> namespaceResources().namespaceExistsAsync(namespaceName))\n            .thenAccept(exists -> {\n                if (!exists) {\n                    throw new RestException(Status.NOT_FOUND, \"Namespace does not exist\");\n                }\n            })\n            .thenCompose(__ -> pulsar().getNamespaceService().getListOfTopicsByProperties(namespaceName,\n               CommandGetTopicsOfNamespace.Mode.PERSISTENT, properties))\n            .thenApply(topics ->\n                topics.stream()\n                    .filter(topic -> {\n                        if (isTransactionInternalName(TopicName.get(topic))) {\n                            return false;\n                        }\n                        if (bundle.isPresent()) {\n                            NamespaceBundle b = pulsar().getNamespaceService().getNamespaceBundleFactory()\n                                .getBundle(TopicName.get(topic));\n                            return b != null && bundle.get().equals(b.getBundleRange());\n                        }\n                        return true;\n                    })\n                    .collect(Collectors.toList())","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java#L156-L192","documentation":"Topic-listing path (via topicNotFoundReasonAsync) reports that the topic's namespace does not exist — the namespace was never created or was deleted, so no topics can be listed under it; returned as 404 Not Found.","triggerScenarios":"Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:174 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the namespace exists with pulsar-admin namespaces list","Recreate the namespace or query the correct tenant/namespace path"],"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-14T05:17:10.506Z"}