{"record":{"id":"c46d2e261dbcbf68","repo":"hyperledger/fabric","slug":"cannot-get-heightsbyendpoints-c46d2e","errorCode":null,"errorMessage":"cannot get HeightsByEndpoints","messagePattern":"cannot get HeightsByEndpoints","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/consensus/smartbft/synchronizer_bft.go","lineNumber":141,"sourceCode":"\treturn decision, nil\n}\n\n// detectTargetHeight probes remote endpoints and detects what is the target height this node needs to reach. It also\n// detects the self-endpoint.\n//\n// In BFT it is highly recommended that the channel/orderer-endpoints (for delivery & broadcast) map 1:1 to the\n// channel/orderers/consenters (for cluster consensus), that is, every consenter should be represented by a\n// delivery endpoint. This important for Sync to work properly.\nfunc (s *BFTSynchronizer) detectTargetHeight() (uint64, string, error) {\n\tblockPuller, err := s.BlockPullerFactory.CreateBlockPuller(s.Support, s.ClusterDialer, s.LocalConfigCluster, s.CryptoProvider)\n\tif err != nil {\n\t\treturn 0, \"\", errors.Wrap(err, \"cannot get create BlockPuller\")\n\t}\n\tdefer blockPuller.Close()\n\n\theightByEndpoint, myEndpoint, err := blockPuller.HeightsByEndpoints()\n\tif err != nil {\n\t\treturn 0, \"\", errors.Wrap(err, \"cannot get HeightsByEndpoints\")\n\t}\n\n\ts.Logger.Infof(\"HeightsByEndpoints: %+v, my endpoint: %s\", heightByEndpoint, myEndpoint)\n\n\tdelete(heightByEndpoint, myEndpoint)\n\tvar heights []uint64\n\tfor _, value := range heightByEndpoint {\n\t\theights = append(heights, value)\n\t}\n\n\tif len(heights) == 0 {\n\t\treturn 0, \"\", errors.New(\"no cluster members to synchronize with\")\n\t}\n\n\ttargetHeight := s.computeTargetHeight(heights)\n\ts.Logger.Infof(\"Detected target height: %d\", targetHeight)\n\treturn targetHeight, myEndpoint, nil\n}","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/consensus/smartbft/synchronizer_bft.go#L123-L159","documentation":"Raised in BFTSynchronizer.detectTargetHeight when blockPuller.HeightsByEndpoints() returns an error while probing all cluster delivery endpoints for their ledger heights. Without these heights the synchronizer cannot compute a target height, so synchronization aborts. The underlying cause (connection, TLS, or authorization failure) is wrapped and should be examined.","triggerScenarios":"HeightsByEndpoints fails after the puller was created: all remote consenter endpoints unreachable on the cluster port, TLS handshake/rejection on Deliver streams, or endpoint resolution returning nothing usable.","commonSituations":"Quorum of peers offline during catch-up; firewall blocking the cluster (7053) port; TLS CA or hostname mismatches between orderers; channel consenter endpoints not mapping 1:1 to delivery endpoints (required for BFT sync, per the source comment).","solutions":["Check the wrapped inner error to identify the failing endpoint(s) and cause","Verify every consenter endpoint is reachable and each consenter has a matching delivery endpoint (1:1)","Fix TLS root CAs / hostnames in channel config and cluster TLS configuration","Bring enough orderers back online so height probing can succeed, then retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Probe all delivery endpoints before attempting sync\nok := 0\nfor _, ep := range consenters {\n    if reachable(ep.Host, ep.Port, tlsConf) { ok++ }\n}\nif ok == 0 {\n    // height probing will certainly fail; fix connectivity first\n}","typeGuard":null,"tryCatchPattern":"resp := bftSynchronizer.Sync()\nif syncFailed(resp) && endpointsWereUnreachable() {\n    time.Sleep(backoff)\n    resp = bftSynchronizer.Sync() // retriable once network/TLS restored\n}","preventionTips":["Ensure 1:1 consenter-to-delivery-endpoint mapping in channel config","Continuously monitor cluster-port reachability and TLS handshakes","Keep quorum of orderers online with automated alerts","Validate CA bundles cover all orderer TLS certificates after rotation"],"tags":["network","tls","consensus","smartbft","fabric"],"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"}