{"record":{"id":"9f6283a916340c8a","repo":"hyperledger/fabric","slug":"endorsement-policy-cannot-be-satisfied","errorCode":null,"errorMessage":"endorsement policy cannot be satisfied","messagePattern":"endorsement policy cannot be satisfied","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"discovery/endorsement/endorsement.go","lineNumber":302,"sourceCode":"\t\t\t\t\" however there exist %d collection policies taken into account\", chaincode.Name, len(policies)-1)\n\t\t\tpolicies = policies[1:]\n\t\t}\n\t\tinquireablePoliciesForChaincodeAndCollections = append(inquireablePoliciesForChaincodeAndCollections, policies...)\n\t}\n\n\tvar cpss []inquire.ComparablePrincipalSets\n\n\tfor _, policy := range inquireablePoliciesForChaincodeAndCollections {\n\t\tvar cmpsets inquire.ComparablePrincipalSets\n\t\tfor _, ps := range policy.SatisfiedBy() {\n\t\t\tcps := inquire.NewComparablePrincipalSet(ps)\n\t\t\tif cps == nil {\n\t\t\t\treturn nil, errors.New(\"failed creating a comparable principal set\")\n\t\t\t}\n\t\t\tcmpsets = append(cmpsets, cps)\n\t\t}\n\t\tif len(cmpsets) == 0 {\n\t\t\treturn nil, errors.New(\"endorsement policy cannot be satisfied\")\n\t\t}\n\t\tcpss = append(cpss, cmpsets)\n\t}\n\n\tstateBasedCPS, err := computeStateBasedPrincipalSets(interest.Chaincodes, sessionLogger)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\n\tif len(stateBasedCPS) > 0 {\n\t\tcpss = append(cpss, stateBasedCPS)\n\t}\n\n\tcps, err := mergePrincipalSets(cpss)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/discovery/endorsement/endorsement.go#L284-L320","documentation":"Thrown by computePrincipalSets when a chaincode or collection endorsement policy inquires (SatisfiedBy) to zero comparable principal sets — meaning no principal combination can satisfy it. Discovery therefore cannot propose any peer group for endorsement and rejects the query.","triggerScenarios":"A committed endorsement policy (namespace or collection) that is logically unsatisfiable: NOutOf threshold higher than the number of sub-policies, references to MSPs absent from the channel, or an empty principal set after inquiry.","commonSituations":"Policies like OUTOF(3, Org1, Org2) with two orgs; org removed from channel after chaincode commit; collection policies requiring principals from MSPs not on the channel; typo'd MSP IDs in the policy string.","solutions":["Lower the NOutOf threshold or add principals so the policy can be satisfied by existing channel members","Verify all MSPs referenced by the policy are configured on the channel (channel config update if needed)","Re-commit or update the chaincode/collection endorsement policy with a satisfiable definition","Check the policy for typo'd MSP IDs using peer chaincode querycommitted / policy inspection"],"exampleFix":"// before\npolicy := \"OUTOF(3, 'Org1MSP.peer', 'Org2MSP.peer')\" // needs 3 of 2\n// after\npolicy := \"OUTOF(2, 'Org1MSP.peer', 'Org2MSP.peer')\"","handlingStrategy":"validation","validationCode":"satisfactions := policy.SatisfiedBy()\nif len(satisfactions) == 0 { return errors.New(\"endorsement policy cannot be satisfied by any channel principal\") }","typeGuard":"func anySatisfyingCombination(p policies.InquireablePolicy) bool {\n  return len(p.SatisfiedBy()) > 0\n}","tryCatchPattern":"peers, err := client.PeersForEndorsement(ctx, interest)\nif err != nil && strings.Contains(err.Error(), \"endorsement policy cannot be satisfied\") {\n  // fix threshold/principals in the committed policy before retry\n}","preventionTips":["Keep NOutOf thresholds <= number of principals listed","Ensure all orgs in the policy remain in channel config","Simulate policy satisfaction after every channel-config or lifecycle change"],"tags":["fabric","discovery","endorsement-policy","unsatisfiable-policy"],"backgroundTag":"endorsement-policy-unsatisfiable","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"}