{"record":{"id":"72b0e3105690fc9d","repo":"apache/pulsar","slug":"failed-to-refresh-self-owner-info","errorCode":null,"errorMessage":"Failed to refresh self owner info.","messagePattern":"Failed to refresh self owner info\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java","lineNumber":209,"sourceCode":"        this.config = pulsar.getConfiguration();\n        this.loadManager = pulsar.getLoadManager();\n        this.bundleFactory = new NamespaceBundleFactory(pulsar, Hashing.crc32());\n        this.ownershipCache = new OwnershipCache(pulsar, this);\n        this.bundleOwnershipListeners = new CopyOnWriteArrayList<>();\n        this.bundleSplitListeners = new CopyOnWriteArrayList<>();\n        this.localBrokerDataCache = pulsar.getLocalMetadataStore().getMetadataCache(LocalBrokerData.class);\n        this.redirectManagerForLoadManagerMigration = new RedirectManagerForLoadManagerMigration(pulsar);\n\n        this.lookupLatencyHistogram = pulsar.getOpenTelemetry().getMeter()\n                .histogramBuilder(LOOKUP_REQUEST_DURATION_METRIC_NAME)\n                .setDescription(\"The duration of topic lookup requests (either binary or HTTP)\")\n                .setUnit(\"s\")\n                .build();\n    }\n\n    public void initialize() {\n        if (!getOwnershipCache().refreshSelfOwnerInfo()) {\n            throw new RuntimeException(\"Failed to refresh self owner info.\");\n        }\n    }\n\n    public CompletableFuture<Optional<LookupResult>> getBrokerServiceUrlAsync(TopicName topic, LookupOptions options) {\n        long startTime = System.nanoTime();\n\n        CompletableFuture<Optional<LookupResult>> future = getBundleAsync(topic)\n                .thenCompose(bundle -> {\n                    // Do redirection if the cluster is in rollback or deploying.\n                    return redirectIfLoadBalancerOnBrokerIsNotExpected(bundle, options).thenCompose(\n                            optResult -> {\n                        if (optResult.isPresent()) {\n                            log.info()\n                                    .attr(\"brokerId\", pulsar.getBrokerId())\n                                    .attr(\"redirect\", optResult.get())\n                                    .attr(\"topic\", topic)\n                                    .log(\"Redirect lookup request\");\n                            return CompletableFuture.completedFuture(optResult);","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java#L191-L227","documentation":"NamespaceService.initialize refreshes the broker's own ownership entry in the ownership cache at startup. If refreshSelfOwnerInfo() returns false the broker cannot confirm its own ownership record, and initialize throws RuntimeException 'Failed to refresh self owner info.', failing broker startup.","triggerScenarios":"Broker startup calls NamespaceService.initialize and the ownership cache cannot write/refresh the self entry in the metadata store (store unavailable, permission denied, stale conflicting record).","commonSituations":"Metadata store (ZooKeeper/etcd/rocksdb) unreachable or misconfigured connection string at boot; leftover ownership nodes from a crashed broker; ACL/kerberos issues writing to the store; split-brain after network partitions.","solutions":["Check broker startup logs and metadata-store connectivity (configurationStoreUrl/brokerServiceUrl, ZK quorum health) and restart the broker once the store is reachable.","Verify the metadata store session/ACLs allow the broker to write under the ownership namespace path.","Clean stale ownership znodes/records for this broker if a prior crashed instance left them behind.","Check for clock/network issues that keep failing the ownership refresh; ensure the metadata store quorum has quiesced after a partition."],"exampleFix":"# before (broker.conf, store down)\nconfigurationStoreServers=zk1:2181  # unreachable\n# after\nconfigurationStoreServers=zk1:2181,zk2:2181,zk3:2181  # healthy quorum","handlingStrategy":"try-catch","validationCode":"// before broker startup, verify metadata store reachability\nCuratorFramework zkc = ...;\nzkc.getZookeeperClient().blockUntilConnectedOrTimedOut(); // fail fast with clear message","typeGuard":null,"tryCatchPattern":"try {\n    namespaceService.initialize();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"Failed to refresh self owner info\")) {\n        log.error(\"Metadata store unavailable/misconfigured; aborting broker start\", e);\n        throw e; // fail startup rather than run half-initialized\n    }\n    throw e;\n}","preventionTips":["Verify configurationStoreServers/zookeeper connectivity as a startup preflight check.","Confirm metadata-store ACLs allow brokers to write ownership paths.","Clean stale ownership records after unclean broker crashes.","Monitor metadata-store session expirations and quorum health."],"tags":["startup","namespace-ownership","metadata-store","zookeeper"],"backgroundTag":"metadata-store-unavailable","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"}