{"record":{"id":"74144265029be3a3","repo":"hyperledger/fabric","slug":"no-endpoints","errorCode":null,"errorMessage":"no endpoints","messagePattern":"no endpoints","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/deliverclient/blocksprovider/bft_censorship_monitor.go","lineNumber":309,"sourceCode":"\n// GetSuspicion returns the suspicion flag, and the header block number that is ahead.\n// If suspicion==false, then suspicionBlockNumber==0.\n//\n// Used mainly for testing.\nfunc (m *BFTCensorshipMonitor) GetSuspicion() (bool, uint64) {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\n\treturn m.suspicion, m.suspicionBlockNumber\n}\n\nfunc (m *BFTCensorshipMonitor) launchHeaderReceivers() error {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\n\tnumEP := len(m.fetchSources)\n\tif numEP <= 0 {\n\t\treturn errors.New(\"no endpoints\")\n\t}\n\n\thRcvToCreate := make([]*orderers.Endpoint, 0)\n\tnow := time.Now()\n\tfor i, ep := range m.fetchSources {\n\t\tif i == m.blockSourceIndex {\n\t\t\tcontinue // skip the block source\n\t\t}\n\n\t\thRcvMon := m.hdrRcvTrackers[ep.Address]\n\t\t// Create a header receiver to sources that\n\t\t// - don't have a running receiver already, and\n\t\t// - don't have a retry deadline in the future\n\t\tif hRcvMon.headerReceiver != nil {\n\t\t\tif !hRcvMon.headerReceiver.IsStopped() {\n\t\t\t\tm.logger.Debugf(\"[%s] Header receiver to: %s, is running\", m.chainID, ep.Address)\n\t\t\t\tcontinue\n\t\t\t}","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/deliverclient/blocksprovider/bft_censorship_monitor.go#L291-L327","documentation":"BFTCensorshipMonitor.launchHeaderReceivers launches header receivers against the configured fetch sources (orderer endpoints). If the fetchSources list is empty there is nothing to monitor, so it returns errors.New(\"no endpoints\") and Monitor cannot start. This guards against silently running a censorship monitor with zero targets.","triggerScenarios":"Monitor calls launchHeaderReceivers while m.fetchSources is empty — the blocks provider was constructed without orderer endpoints, or all endpoints were removed/pruned before monitor launch.","commonSituations":"Empty or missing orderer endpoint list in client config (no orderers under the channel's connection profile); all endpoints filtered out after failed connection attempts; programmatic construction of the blocks provider without calling the endpoint-population step.","solutions":["Add at least one valid orderer endpoint (host:port with TLS material) to the channel/client configuration.","Check the connection profile or config block parsing to ensure orderer endpoints are populated for this channel.","Reinitialize/recreate the blocks provider after endpoints become available instead of calling Monitor with an empty list.","Log and inspect m.fetchSources at construction time to find where endpoints were dropped."],"exampleFix":"// before\nprovider.Initialize(chaChan, []string{})\nmonitor.Monitor() // panics with 'no endpoints'\n// after\nendpoints := []string{\"orderer.example.com:7050\", \"orderer2.example.com:7050\"}\nif len(endpoints) == 0 {\n    return fmt.Errorf(\"cannot start monitor: no orderer endpoints configured\")\n}\nprovider.Initialize(chaChan, endpoints)\nmonitor.Monitor()","handlingStrategy":"validation","validationCode":"if len(fetchSources) == 0 {\n    return fmt.Errorf(\"cannot start BFT censorship monitor: no orderer endpoints configured\")\n}","typeGuard":null,"tryCatchPattern":"if err := monitor.Monitor(); err != nil {\n    if err.Error() == \"no endpoints\" {\n        // reload endpoints from config/channel ledger and retry Monitor()\n    }\n}","preventionTips":["Always configure at least one (ideally several) orderer endpoints per channel.","Validate the connection profile on startup, before starting background monitors.","Re-fetch orderer endpoints from the latest config block if the static list is empty.","Log endpoint list size when constructing the blocks provider."],"tags":["fabric","deliver-client","configuration","bft-censorship-monitor","empty-endpoints"],"backgroundTag":"no-endpoints-configured","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"}