hyperledger/fabric · error

failed to find any endorsing peers for org(s): %s

Error message

failed to find any endorsing peers for org(s): %s

What it means

Gateway planForOrgs: one or more of the organizations named in endorsingOrgs has no discovered endorsing peers for the chaincode on the channel, so a layout with one peer from each requested org cannot be built. The message lists the missing org(s).

Source

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

// 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
		} else {
			missingOrgs = append(missingOrgs, org)
		}
	}
	if len(missingOrgs) > 0 {
		return nil, fmt.Errorf("failed to find any endorsing peers for org(s): %s", strings.Join(missingOrgs, ", "))
	}

	return newPlan([]*layout{{required: required}}, groupEndorsers), nil
}

func (reg *registry) endorsersByOrg(channel string, chaincode string) map[string][]*endorserState {
	endorsersByOrg := make(map[string][]*endorserState)

	for _, member := range reg.channelMembers(channel) {
		endorser := reg.lookupEndorser(member.PreferredEndpoint(), member.PKIid, channel)
		if endorser == nil {
			continue
		}
		if reg.hasChaincode(member, chaincode) {
			endorsersByOrg[endorser.mspid] = append(endorsersByOrg[endorser.mspid], &endorserState{endorser: endorser, height: member.Properties.GetLedgerHeight()})
		}
	}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Verify the org names passed in the request are correct
  2. Ensure peers of those orgs have joined the channel and run the chaincode
  3. Wait/retry until discovery reports endorsers for those orgs
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at internal/pkg/gateway/registry.go:179 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/8356199b76644905. Report an issue: GitHub.