hyperledger/fabric · error

no Raft leader

Error message

no Raft leader

What it means

Returned when a Submit request is delivered to a node that has no known Raft leader (lead == raft.None). The chain forwards the request through the internal submit channel and waits for the current leader; if the Raft group cannot report one (no quorum or election in progress), this error is produced.

Source

Thrown at orderer/consensus/etcdraft/chain.go:557

}

// Submit forwards the incoming request to:
// - the local run goroutine if this is leader
// - the actual leader via the transport mechanism
// The call fails if there's no leader elected yet.
func (c *Chain) Submit(req *orderer.SubmitRequest, sender uint64) error {
	if err := c.isRunning(); err != nil {
		c.Metrics.ProposalFailures.Add(1)
		return err
	}

	leadC := make(chan uint64, 1)
	select {
	case c.submitC <- &submit{req, leadC}:
		lead := <-leadC
		if lead == raft.None {
			c.Metrics.ProposalFailures.Add(1)
			return errors.Errorf("no Raft leader")
		}

		if lead != c.raftID {
			if err := c.forwardToLeader(lead, req); err != nil {
				return err
			}
		}

	case <-c.doneC:
		c.Metrics.ProposalFailures.Add(1)
		return errors.Errorf("chain is stopped")
	}

	return nil
}

func (c *Chain) forwardToLeader(lead uint64, req *orderer.SubmitRequest) error {
	c.logger.Infof("Forwarding transaction to the leader %d", lead)

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Check orderer logs for 'leader changed' / 'no leader' and confirm a majority of Raft nodes are online and connected.
  2. Verify network connectivity and TLS certificates between ordering nodes on the Raft port (7050 cluster port).
  3. Wait for the leader election to complete and retry the transaction submission.
  4. If quorum is permanently lost, restore the failed orderer from the same genesis/channel data or re-provision the ordering service.
Defensive patterns

Strategy: validation

Validate before calling

meta := &etcdraft.ClusterMetadata{}
if err := proto.Unmarshal(req.GetMetadata(), meta); err != nil {
    return nil, fmt.Errorf("rejecting step request: invalid cluster metadata: %w", err)
}

Type guard

func validClusterMetadata(b []byte) bool {
    m := &etcdraft.ClusterMetadata{}
    return len(b) > 0 && proto.Unmarshal(b, m) == nil
}

Prevention

When it happens

Trigger: Calling orderer Submit/Broadcast while the Raft cluster has no elected leader — e.g. fewer than a majority of ordering nodes are up, an election is still in progress after a leader crash, or the chain is mid-reconfiguration.

Common situations: Too many orderer replicas down in a 3- or 5-node cluster (quorum lost); cluster just started and leader election hasn't completed; network partition isolating the follower the client connects to.

Related errors


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