{"record":{"id":"90de8ccad368e8b2","repo":"hyperledger/fabric","slug":"group-s-isn-t-mapped-to-endorsers-but-exists-in","errorCode":null,"errorMessage":"group %s isn't mapped to endorsers, but exists in a layout","messagePattern":"group (.+?) isn't mapped to endorsers, but exists in a layout","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"discovery/client/client.go","lineNumber":510,"sourceCode":"\t\t\treturn err\n\t\t}\n\t\tresp[key] = descriptor\n\t}\n\n\treturn nil\n}\n\nfunc (resp response) createEndorsementDescriptor(desc *discovery.EndorsementDescriptor, channel string) (*endorsementDescriptor, error) {\n\tdescriptor := &endorsementDescriptor{\n\t\tlayouts:           []map[string]int{},\n\t\tendorsersByGroups: make(map[string][]*Peer),\n\t}\n\tfor _, l := range desc.Layouts {\n\t\tcurrentLayout := make(map[string]int)\n\t\tdescriptor.layouts = append(descriptor.layouts, currentLayout)\n\t\tfor grp, count := range l.QuantitiesByGroup {\n\t\t\tif _, exists := desc.EndorsersByGroups[grp]; !exists {\n\t\t\t\treturn nil, errors.Errorf(\"group %s isn't mapped to endorsers, but exists in a layout\", grp)\n\t\t\t}\n\t\t\tcurrentLayout[grp] = int(count)\n\t\t}\n\t}\n\n\tfor grp, peers := range desc.EndorsersByGroups {\n\t\tvar endorsers []*Peer\n\t\tfor _, p := range peers.Peers {\n\t\t\tpeer, err := endorser(p, desc.Chaincode, channel)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"failed creating endorser object\")\n\t\t\t}\n\t\t\tendorsers = append(endorsers, peer)\n\t\t}\n\t\tdescriptor.endorsersByGroups[grp] = endorsers\n\t}\n\n\treturn descriptor, nil","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/discovery/client/client.go#L492-L528","documentation":"createEndorsementDescriptor validates that every group referenced in an endorsement descriptor's Layouts (QuantitiesByGroup) also appears in the descriptor's EndorsersByGroups map. When a layout requires a group the server never populated with endorsers, this error names the missing group. It indicates inconsistent endorsement descriptor data returned by the discovery server.","triggerScenarios":"Processing a discovery ChaincodeQueryResult whose EndorsementDescriptor has a layout quantity key with no matching entry in EndorsersByGroups — typically when the server has layout plans for peers/groups (e.g. by MSP or organization) but no live endorsers discovered for that group.","commonSituations":"An organization's peers are down or not gossiped yet so the server knows the layout but has no endorsers for the group; anchor peer misconfiguration breaking cross-org gossip; new org added to channel policy before its peers joined; stale discovery cache on the peer.","solutions":["Ensure all organizations/groups in the endorsement policy have reachable peers that joined the channel","Verify anchor peers are configured so gossip disseminates membership across orgs","Check that the endorsement policy's required orgs actually have peers running the chaincode","Retry after gossip converges (peers may still be joining)","Inspect peer discovery logs to see why the group's endorsers list is empty"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pre-check: all orgs in the endorsement policy have live peers\nfor _, org := range policyOrgs(channel) {\n\tif !hasLivePeerInOrg(channel, org) {\n\t\treturn fmt.Errorf(\"org %s has no live peers on channel %s\", org, channel)\n\t}\n}","typeGuard":null,"tryCatchPattern":"desc, err := resolveEndorsers(ctx)\nif err != nil && strings.Contains(err.Error(), \"isn't mapped to endorsers\") {\n\t// org peers likely still joining; wait and retry\n\ttime.Sleep(5 * time.Second)\n\tdesc, err = resolveEndorsers(ctx)\n}","preventionTips":["Configure anchor peers so all orgs gossip membership","Add orgs' peers before enforcing policies requiring them","Wait for gossip convergence after channel membership changes","Monitor peer liveness per organization"],"tags":["hyperledger-fabric","discovery-service","endorsement-policy","gossip"],"backgroundTag":"endorsement-group-missing","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"}