hyperledger/fabric · error

timed out waiting for txid on all peers

Error message

timed out waiting for txid on all peers

What it means

DeliverGroup.Wait blocks until every peer in the group has observed the transaction ID in a delivered block, bounded by the context timeout. If the transaction is not seen on all peers before the timeout, this error is returned.

Source

Thrown at internal/peer/chaincode/common.go:714

func (dg *DeliverGroup) Wait(ctx context.Context) error {
	if len(dg.Clients) == 0 {
		return nil
	}

	dg.wg.Add(len(dg.Clients))
	for _, client := range dg.Clients {
		go dg.ClientWait(client)
	}
	readyCh := make(chan struct{})
	go dg.WaitForWG(readyCh)

	select {
	case <-readyCh:
		if dg.Error != nil {
			return dg.Error
		}
	case <-ctx.Done():
		err := errors.New("timed out waiting for txid on all peers")
		return err
	}

	return nil
}

// ClientWait waits for the specified deliver client to receive
// a block event with the requested txid
func (dg *DeliverGroup) ClientWait(dc *DeliverClient) {
	defer dg.wg.Done()
	for {
		resp, err := dc.Connection.Recv()
		if err != nil {
			err = errors.WithMessagef(err, "error receiving from deliver filtered at %s", dc.Address)
			dg.setError(err)
			return
		}
		switch r := resp.Type.(type) {

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Increase --waitForEventTimeout to exceed worst-case commit latency
  2. Check each peer's commit status (peer channel fetch / logs) to find which peer lagged or rejected the tx
  3. Inspect orderer metrics/logs for backlog; scale orderers or increase batch timeouts
  4. Verify the tx actually committed via `peer chaincode query` or block exploration

Example fix

// before
peer chaincode invoke ... --waitForEvent --waitForEventTimeout 30s
// after
peer chaincode invoke ... --waitForEvent --waitForEventTimeout 300s
Defensive patterns

Strategy: retry

Validate before calling

// verify tx committed via query before relying on waitForEvent
_, err := cli.Query(channelID, chaincodeName, args)
if err != nil { /* tx may not have committed on all peers */ }

Try / catch

if strings.Contains(err.Error(), "timed out waiting for txid") {
    // poll commit status / query until confirmed or permanent failure
    return pollCommitStatus(txID, extendedDeadline)
}

Prevention

When it happens

Trigger: Invoke with --waitForEvent where the tx is committed slowly (ordering backlog, slow validation) or never commits on some peer (that peer behind/lagged), exceeding --waitForEventTimeout.

Common situations: Congested orderer service delaying block creation; a peer that rejected the tx (different validation result) so its event never arrives; large batches with default 30s timeout.

Understand the failure class

Related errors


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