hyperledger/fabric · error

no endpoints

Error message

no endpoints

What it means

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.

Source

Thrown at common/deliverclient/blocksprovider/bft_censorship_monitor.go:309

// GetSuspicion returns the suspicion flag, and the header block number that is ahead.
// If suspicion==false, then suspicionBlockNumber==0.
//
// Used mainly for testing.
func (m *BFTCensorshipMonitor) GetSuspicion() (bool, uint64) {
	m.mutex.Lock()
	defer m.mutex.Unlock()

	return m.suspicion, m.suspicionBlockNumber
}

func (m *BFTCensorshipMonitor) launchHeaderReceivers() error {
	m.mutex.Lock()
	defer m.mutex.Unlock()

	numEP := len(m.fetchSources)
	if numEP <= 0 {
		return errors.New("no endpoints")
	}

	hRcvToCreate := make([]*orderers.Endpoint, 0)
	now := time.Now()
	for i, ep := range m.fetchSources {
		if i == m.blockSourceIndex {
			continue // skip the block source
		}

		hRcvMon := m.hdrRcvTrackers[ep.Address]
		// Create a header receiver to sources that
		// - don't have a running receiver already, and
		// - don't have a retry deadline in the future
		if hRcvMon.headerReceiver != nil {
			if !hRcvMon.headerReceiver.IsStopped() {
				m.logger.Debugf("[%s] Header receiver to: %s, is running", m.chainID, ep.Address)
				continue
			}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Add at least one valid orderer endpoint (host:port with TLS material) to the channel/client configuration.
  2. Check the connection profile or config block parsing to ensure orderer endpoints are populated for this channel.
  3. Reinitialize/recreate the blocks provider after endpoints become available instead of calling Monitor with an empty list.
  4. Log and inspect m.fetchSources at construction time to find where endpoints were dropped.

Example fix

// before
provider.Initialize(chaChan, []string{})
monitor.Monitor() // panics with 'no endpoints'
// after
endpoints := []string{"orderer.example.com:7050", "orderer2.example.com:7050"}
if len(endpoints) == 0 {
    return fmt.Errorf("cannot start monitor: no orderer endpoints configured")
}
provider.Initialize(chaChan, endpoints)
monitor.Monitor()
Defensive patterns

Strategy: validation

Validate before calling

if len(fetchSources) == 0 {
    return fmt.Errorf("cannot start BFT censorship monitor: no orderer endpoints configured")
}

Try / catch

if err := monitor.Monitor(); err != nil {
    if err.Error() == "no endpoints" {
        // reload endpoints from config/channel ledger and retry Monitor()
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/74144265029be3a3. Report an issue: GitHub.