{"record":{"id":"85c11f2bbac9685d","repo":"hyperledger/fabric","slug":"failed-to-select-a-set-of-endorsers-that-satisfy-t","errorCode":null,"errorMessage":"failed to select a set of endorsers that satisfy the endorsement policy due to unavailability of peers: %v","messagePattern":"failed to select a set of endorsers that satisfy the endorsement policy due to unavailability of peers: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pkg/gateway/registry.go","lineNumber":155,"sourceCode":"\t\t}\n\t\tif len(quantityByGroup) == 0 {\n\t\t\t// empty layout\n\t\t\tbreak\n\t\t}\n\t\tif hasPreferredGroup {\n\t\t\tpreferredLayouts = append(preferredLayouts, &layout{required: quantityByGroup})\n\t\t} else {\n\t\t\totherLayouts = append(otherLayouts, &layout{required: quantityByGroup})\n\t\t}\n\t}\n\n\t// shuffle the layouts - keep the preferred ones first\n\trand.Shuffle(len(preferredLayouts), func(i, j int) { preferredLayouts[i], preferredLayouts[j] = preferredLayouts[j], preferredLayouts[i] })\n\trand.Shuffle(len(otherLayouts), func(i, j int) { otherLayouts[i], otherLayouts[j] = otherLayouts[j], otherLayouts[i] })\n\tlayouts := append(preferredLayouts, otherLayouts...)\n\n\tif len(layouts) == 0 {\n\t\treturn nil, fmt.Errorf(\"failed to select a set of endorsers that satisfy the endorsement policy due to unavailability of peers: %v\", unavailableEndorsers)\n\t}\n\n\treturn newPlan(layouts, groupEndorsers), nil\n}\n\n// 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.\nfunc (reg *registry) planForOrgs(channel string, chaincode string, endorsingOrgs []string) (*plan, error) {\n\tendorsersByOrg := reg.endorsersByOrg(channel, chaincode)\n\n\trequired := map[string]int{}\n\tgroupEndorsers := map[string][]*endorser{}\n\tmissingOrgs := []string{}\n\tfor _, org := range endorsingOrgs {\n\t\tif es, ok := endorsersByOrg[org]; ok {\n\t\t\tfor _, e := range es {\n\t\t\t\tgroupEndorsers[org] = append(groupEndorsers[org], e.endorser)\n\t\t\t}\n\t\t\trequired[org] = 1","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/pkg/gateway/registry.go#L137-L173","documentation":"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.","triggerScenarios":"Thrown at internal/pkg/gateway/registry.go:155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Bring unavailable endorsing peers back online","Check network connectivity from the gateway peer to endorsing peers","Retry the transaction once peers recover"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}