{"record":{"id":"9f223ed2bf8a7cf3","repo":"apache/pulsar","slug":"invalid-cluster-id-clusterid-9f223e","errorCode":null,"errorMessage":"Invalid cluster id: ${clusterId}","messagePattern":"Invalid cluster id: (.+?)","errorType":"http","errorClass":"RestException","httpStatus":403,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java","lineNumber":3591,"sourceCode":"                                if (v.replication_clusters.contains(clusterId)) {\n                                    continue;\n                                }\n                                return FutureUtil.failedFuture(new RestException(Response.Status.PRECONDITION_FAILED,\n                                    \"The policies at the global topic level will only be copied to the clusters\"\n                                    + \" included in the namespace level replication. Therefore, please do not set the\"\n                                    + \" policies including other clusters\"));\n                            }\n                            return CompletableFuture.completedFuture(null);\n                        });\n                    }\n                    return CompletableFuture.completedFuture(null);\n                })\n                .thenCompose(__ -> clustersAsync())\n                .thenCompose(clusters -> {\n                    List<CompletableFuture<Void>> futures = new ArrayList<>(replicationClustersSet.size());\n                    for (String clusterId : replicationClustersSet) {\n                        if (!clusters.contains(clusterId)) {\n                            throw new RestException(Status.FORBIDDEN, \"Invalid cluster id: \" + clusterId);\n                        }\n                        futures.add(validatePeerClusterConflictAsync(clusterId, replicationClustersSet));\n                        futures.add(validateClusterForTenantAsync(namespaceName.getTenant(), clusterId));\n                    }\n                    return FutureUtil.waitForAll(futures);\n                }).thenCompose(__ -> {\n                    if (!pulsar().getConfig().isCreateTopicToRemoteClusterForReplication()) {\n                        log.info()\n                                .attr(\"topic\", topicName)\n                                .attr(\"clusters\", replicationClustersSet.stream().filter(v ->\n                                        !pulsar().getConfig().getClusterName().equals(v)).collect(Collectors\n                                                .toList())).log(\"Skip creating partitioned for topic for the remote\"\n                                                        + \" clusters\");\n                        return CompletableFuture.completedFuture(null);\n                    }\n                    // Sync to create partitioned topic on the remote cluster if needed.\n                    TopicName topicNameWithoutPartition = TopicName.get(topicName.getPartitionedTopicName());\n                    return pulsar().getPulsarResources().getNamespaceResources().getPartitionedTopicResources()","sourceCodeStart":3573,"sourceCodeEnd":3609,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java#L3573-L3609","documentation":"Setting topic-level replication policies failed because the request includes a cluster that is not in the namespace-level replication set; global topic policies can only copy to namespace-replicated clusters (412).","triggerScenarios":"Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:3591 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the cluster to the namespace's replicationClusters first","Restrict the topic-level policy to clusters already in the namespace replication set"],"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"}