apache/pulsar · error · RestException

Shadow topic [${shadowTopic}] not exists.

Error message

Shadow topic [${shadowTopic}] not exists.

What it means

validateShadowTopics checks each configured shadow topic before applying the policy; the referenced shadow topic does not exist, so the shadow-topic policy is rejected because it would point at a nonexistent source topic.

Source

Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5647

            policies.setEntryFilters(null);
        });
    }

    protected CompletableFuture<Void> validateShadowTopics(List<String> shadowTopics) {
        List<CompletableFuture<Void>> futures = new ArrayList<>(shadowTopics.size());
        for (String shadowTopic : shadowTopics) {
            try {
                TopicName shadowTopicName = TopicName.get(shadowTopic);
                if (!shadowTopicName.isPersistent()) {
                    return FutureUtil.failedFuture(new RestException(Status.PRECONDITION_FAILED,
                            "Only persistent topic can be set as shadow topic"));
                }
                futures.add(pulsar().getNamespaceService().checkTopicExistsAsync(shadowTopicName)
                        .thenAccept(info -> {
                            boolean exists = info.isExists();
                            info.recycle();
                            if (!exists) {
                                throw new RestException(Status.PRECONDITION_FAILED,
                                        "Shadow topic [" + shadowTopic + "] not exists.");
                            }
                        }));
            } catch (IllegalArgumentException e) {
                return FutureUtil.failedFuture(new RestException(Status.FORBIDDEN,
                        "Invalid shadow topic name: " + shadowTopic));
            }
        }
        return FutureUtil.waitForAll(futures);
    }

    protected CompletableFuture<Void> internalSetShadowTopic(List<String> shadowTopics) {
        if (!topicName.isPersistent()) {
            return FutureUtil.failedFuture(new RestException(Status.PRECONDITION_FAILED,
                    "Only persistent source topic is supported with shadow topics."));
        }
        if (CollectionUtils.isEmpty(shadowTopics)) {
            return FutureUtil.failedFuture(new RestException(Status.PRECONDITION_FAILED,

View on GitHub (pinned to 820761864e)

Solutions

  1. Create the shadow topic before referencing it
  2. Remove the nonexistent name from the shadowTopics list
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5647 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/ea9a97079539b416. Report an issue: GitHub.