{"record":{"id":"58e90231c498979e","repo":"hyperledger/fabric","slug":"cannot-get-detect-target-height","errorCode":null,"errorMessage":"cannot get detect target height","messagePattern":"cannot get detect target height","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/consensus/smartbft/synchronizer_bft.go","lineNumber":92,"sourceCode":"\t\t\tCurrentConfig:         s.lastReconfig.CurrentConfig,\n\t\t\tCurrentNodes:          s.lastReconfig.CurrentNodes,\n\t\t},\n\t}\n}\n\n// Buffer return the internal SyncBuffer for testability.\nfunc (s *BFTSynchronizer) Buffer() *SyncBuffer {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\n\treturn s.syncBuff\n}\n\nfunc (s *BFTSynchronizer) synchronize() (*types.Decision, error) {\n\t// === We probe all the endpoints and establish a target height, as well as detect the self endpoint.\n\ttargetHeight, myEndpoint, err := s.detectTargetHeight()\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"cannot get detect target height\")\n\t}\n\n\tstartHeight := s.Support.Height()\n\tif startHeight >= targetHeight {\n\t\treturn nil, errors.Errorf(\"already at target height of %d\", targetHeight)\n\t}\n\n\t// === Create a buffer to accept the blocks delivered from the BFTDeliverer.\n\tcapacityBlocks := max(uint(s.LocalConfigCluster.ReplicationBufferSize)/uint(s.Support.SharedConfig().BatchSize().AbsoluteMaxBytes), 100)\n\ts.mutex.Lock()\n\ts.syncBuff = NewSyncBuffer(capacityBlocks)\n\ts.mutex.Unlock()\n\n\t// === Create the BFT block deliverer and start a go-routine that fetches block and inserts them into the syncBuffer.\n\tbftDeliverer, err := s.createBFTDeliverer(startHeight, myEndpoint)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"cannot create BFT block deliverer\")\n\t}","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/consensus/smartbft/synchronizer_bft.go#L74-L110","documentation":"Raised in BFTSynchronizer.synchronize when detectTargetHeight() returns an error, wrapped with 'cannot get detect target height'. detectTargetHeight probes all cluster delivery endpoints (via a BlockPuller) to compute the target height and identify this node's own endpoint; any failure creating the puller or probing heights surfaces here.","triggerScenarios":"BFTSynchronizer.Sync -> synchronize -> detectTargetHeight fails: CreateBlockPuller errors (bad TLS/dialer config) or HeightsByEndpoints errors (all remote endpoints unreachable, Deliver failures).","commonSituations":"Cluster peers down or partitioned during leader election/catch-up; TLS misconfiguration in the cluster section; consenter endpoints in channel config not mapping 1:1 to delivery endpoints (explicitly warned against in the source comment); DNS/firewall issues on the cluster port.","solutions":["Inspect the inner wrapped error for the root cause (puller creation vs. height probing)","Verify every consenter has a corresponding, reachable delivery endpoint (1:1 mapping required for BFT sync)","Fix cluster TLS certs/CAs and dialer configuration","Restore quorum: bring enough orderers online so height probing succeeds"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check: every consenter must map to a reachable delivery endpoint\nfor _, c := range sharedConfig.Consenters() {\n    if !reachable(c.Host, c.Port, tlsConf) {\n        log.Printf(\"BFT sync will fail: endpoint %s:%s unreachable\", c.Host, c.Port)\n    }\n}","typeGuard":null,"tryCatchPattern":"resp := bftSynchronizer.Sync()\n// On error the SyncResponse is built from the local ledger; detect and retry later\nif resp.Latest.Height <= localHeight && quorumOffline() {\n    scheduleRetrySync(backoff)\n}","preventionTips":["Maintain a strict 1:1 mapping between consenters and delivery endpoints in channel config","Monitor cluster-port reachability for all BFT nodes","Keep TLS certificates and CAs in sync across the cluster","Restore quorum quickly with automated alerting on orderer downtime"],"tags":["consensus","smartbft","fabric","network"],"backgroundTag":"cluster-endpoint-unreachable","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}