hyperledger/fabric · error

failed to select a set of endorsers that satisfy the endorse

Error message

failed to select a set of endorsers that satisfy the endorsement policy due to unavailability of peers: %v

What it means

Gateway endorsementPlan: discovery returned layouts, but after excluding unavailable/disconnected endorsers no layout could be satisfied — the listed peer sets cannot meet the endorsement policy right now.

Source

Thrown at internal/pkg/gateway/registry.go:155

		}
		if len(quantityByGroup) == 0 {
			// empty layout
			break
		}
		if hasPreferredGroup {
			preferredLayouts = append(preferredLayouts, &layout{required: quantityByGroup})
		} else {
			otherLayouts = append(otherLayouts, &layout{required: quantityByGroup})
		}
	}

	// shuffle the layouts - keep the preferred ones first
	rand.Shuffle(len(preferredLayouts), func(i, j int) { preferredLayouts[i], preferredLayouts[j] = preferredLayouts[j], preferredLayouts[i] })
	rand.Shuffle(len(otherLayouts), func(i, j int) { otherLayouts[i], otherLayouts[j] = otherLayouts[j], otherLayouts[i] })
	layouts := append(preferredLayouts, otherLayouts...)

	if len(layouts) == 0 {
		return nil, fmt.Errorf("failed to select a set of endorsers that satisfy the endorsement policy due to unavailability of peers: %v", unavailableEndorsers)
	}

	return newPlan(layouts, groupEndorsers), nil
}

// planForOrgs generates an endorsement plan with a single layout requiring one peer from each of the given orgs for the given chaincode on a channel.
func (reg *registry) planForOrgs(channel string, chaincode string, endorsingOrgs []string) (*plan, error) {
	endorsersByOrg := reg.endorsersByOrg(channel, chaincode)

	required := map[string]int{}
	groupEndorsers := map[string][]*endorser{}
	missingOrgs := []string{}
	for _, org := range endorsingOrgs {
		if es, ok := endorsersByOrg[org]; ok {
			for _, e := range es {
				groupEndorsers[org] = append(groupEndorsers[org], e.endorser)
			}
			required[org] = 1

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Bring unavailable endorsing peers back online
  2. Check network connectivity from the gateway peer to endorsing peers
  3. Retry the transaction once peers recover
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/pkg/gateway/registry.go:155 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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