{"record":{"id":"446fef3afc00c94a","repo":"hyperledger/fabric","slug":"cannot-get-heightsbyendpoints","errorCode":null,"errorMessage":"cannot get HeightsByEndpoints","messagePattern":"cannot get HeightsByEndpoints","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/consensus/smartbft/synchronizer.go","lineNumber":91,"sourceCode":"\tif err != nil {\n\t\treturn nil, 0\n\t}\n\n\tlastConfigSqn := s.Support.Sequence()\n\n\treturn viewMetadata, lastConfigSqn\n}\n\nfunc (s *Synchronizer) synchronize() (*types.Decision, error) {\n\tblockPuller, err := s.BlockPullerFactory.CreateBlockPuller(s.Support, s.ClusterDialer, s.LocalConfigCluster, s.CryptoProvider)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"cannot get create BlockPuller\")\n\t}\n\tdefer blockPuller.Close()\n\n\theightByEndpoint, _, err := blockPuller.HeightsByEndpoints()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"cannot get HeightsByEndpoints\")\n\t}\n\n\ts.Logger.Infof(\"HeightsByEndpoints: %v\", heightByEndpoint)\n\n\tif len(heightByEndpoint) == 0 {\n\t\treturn nil, errors.New(\"no cluster members to synchronize with\")\n\t}\n\n\tvar heights []uint64\n\tfor _, value := range heightByEndpoint {\n\t\theights = append(heights, value)\n\t}\n\n\ttargetHeight := s.computeTargetHeight(heights)\n\tstartHeight := s.Support.Height()\n\tif startHeight >= targetHeight {\n\t\treturn nil, errors.Errorf(\"already at height of %d\", targetHeight)\n\t}","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/consensus/smartbft/synchronizer.go#L73-L109","documentation":"Raised in Synchronizer.synchronize when blockPuller.HeightsByEndpoints() returns an error. The orderer probes all cluster delivery endpoints to learn their ledger heights before replicating blocks; this error means the height probe itself failed for every relevant endpoint (wrapped underlying cause, e.g. all endpoints unreachable, TLS failures, or no endpoints resolved).","triggerScenarios":"BlockPuller creation succeeded but HeightsByEndpoints returned an error: all remote consenter delivery endpoints refused/failed connections, TLS handshake failures with remote orderers, channel membership/endpoint resolution returned no usable endpoints, or remote orderers rejected the Deliver stream.","commonSituations":"Orderer joining a channel where other cluster members are down or unreachable over the cluster port; TLS certificate/CA mismatches between orderers; wrong external endpoints configured in the channel consenter entries; network partition or firewall blocking the cluster (port 7053) traffic.","solutions":["Check the wrapped cause in the log (the error is a pkg/errors wrap) — fix the underlying connection/TLS problem it names","Verify every consenter's host:port in the channel config is reachable from this orderer (test with nc/openssl s_client)","Verify TLS root CAs in the channel config cover all orderer TLS certificates and hostnames match SANs","Restart/repair the peer orderers so at least a quorum of the cluster is up, then let the node rejoin"],"exampleFix":"// before (orderer.yaml cluster section pointing to wrong address)\ncluster:\n  serverCertificate: ...wrong-cert...\n// after\ncluster:\n  serverCertificate: /var/hyperledger/orderer/tls/server.crt\n  serverPrivateKey: /var/hyperledger/orderer/tls/server.key\n  # and ensure channel config consenters host:port are correct/reachable","handlingStrategy":"try-catch","validationCode":"// Before relying on Sync, probe cluster reachability\nfor _, ep := range consenters {\n    conn, err := tls.Dial(\"tcp\", ep.Host+\":\"+ep.Port, tlsConf)\n    if err != nil {\n        log.Printf(\"consenter %s:%s unreachable: %v\", ep.Host, ep.Port, err)\n    } else {\n        conn.Close()\n    }\n}","typeGuard":null,"tryCatchPattern":"resp := synchronizer.Sync()\n// Go: Sync returns SyncResponse; on failure it falls back to local ledger.\n// Detect the error via logs or by comparing heights:\nif resp.Latest.Height <= localHeight {\n    // sync failed; handle degraded state from local ledger\n}","preventionTips":["Monitor cluster-port connectivity between all orderers continuously","Keep channel consenter endpoints and TLS CAs consistent across the network","Alert on orderer process downtime to restore quorum quickly","Verify TLS SANs match configured hostnames at deployment time"],"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"}