apache/pulsar · error · RestException
Namespace does not exist
Error message
Namespace does not exist
What it means
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.
Source
Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:174
import org.jspecify.annotations.Nullable;
/**
*/
public class PersistentTopicsBase extends AdminResource {
private static final io.github.merlimat.slog.Logger LOG =
io.github.merlimat.slog.Logger.get(PersistentTopicsBase.class);
private static final int OFFLINE_TOPIC_STAT_TTL_MINS = 10;
private static final String DEPRECATED_CLIENT_VERSION_PREFIX = "Pulsar-CPP-v";
private static final Version LEAST_SUPPORTED_CLIENT_VERSION_PREFIX = Version.forIntegers(1, 21);
protected CompletableFuture<List<String>> internalGetListAsync(Optional<String> bundle,
@Nullable Map<String, String> properties) {
return validateNamespaceOperationAsync(namespaceName, NamespaceOperation.GET_TOPICS)
.thenCompose(__ -> namespaceResources().namespaceExistsAsync(namespaceName))
.thenAccept(exists -> {
if (!exists) {
throw new RestException(Status.NOT_FOUND, "Namespace does not exist");
}
})
.thenCompose(__ -> pulsar().getNamespaceService().getListOfTopicsByProperties(namespaceName,
CommandGetTopicsOfNamespace.Mode.PERSISTENT, properties))
.thenApply(topics ->
topics.stream()
.filter(topic -> {
if (isTransactionInternalName(TopicName.get(topic))) {
return false;
}
if (bundle.isPresent()) {
NamespaceBundle b = pulsar().getNamespaceService().getNamespaceBundleFactory()
.getBundle(TopicName.get(topic));
return b != null && bundle.get().equals(b.getBundleRange());
}
return true;
})
.collect(Collectors.toList())View on GitHub (pinned to 820761864e)
Solutions
- Verify the namespace exists with pulsar-admin namespaces list
- Recreate the namespace or query the correct tenant/namespace path
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:174 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/8cb335185308f911.
Report an issue: GitHub.