{"record":{"id":"5d1da8d126a89715","repo":"hyperledger/fabric","slug":"validation-of-endorsement-policy-for-chaincode-s-5d1da8","errorCode":null,"errorMessage":"validation of endorsement policy for chaincode %s in tx %d:%d failed","messagePattern":"validation of endorsement policy for chaincode (.+?) in tx (.+?):(.+?) failed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/common/validation/statebased/v20.go","lineNumber":141,"sourceCode":"\t\t\t\treturn policyErr(errors.Wrapf(err, \"validation of endorsement policy for collection %s chaincode %s in tx %d:%d failed\", coll, cc, blockNum, txNum))\n\t\t\t}\n\n\t\t\tp.nsEPChecked[coll] = true\n\t\t\tp.someEPChecked = true\n\t\t\treturn nil\n\t\t}\n\t}\n\n\t// we're here either because we're not in a collection or because there was\n\t// no endorsement policy for that collection - we turn to the chaincode EP\n\tif p.nsEPChecked[\"\"] {\n\t\treturn nil\n\t}\n\n\t// evaluate the cc EP\n\terr := p.policySupport.Evaluate(p.ccEP, sd)\n\tif err != nil {\n\t\treturn policyErr(errors.Wrapf(err, \"validation of endorsement policy for chaincode %s in tx %d:%d failed\", cc, blockNum, txNum))\n\t}\n\n\tp.nsEPChecked[\"\"] = true\n\tp.someEPChecked = true\n\treturn nil\n}\n\nfunc (p *policyCheckerV20) CheckCCEPIfNoEPChecked(cc string, blockNum, txNum uint64, sd []*protoutil.SignedData) commonerrors.TxValidationError {\n\tif p.someEPChecked {\n\t\treturn nil\n\t}\n\n\t// validate against cc ep\n\terr := p.policySupport.Evaluate(p.ccEP, sd)\n\tif err != nil {\n\t\treturn policyErr(errors.Wrapf(err, \"validation of endorsement policy for chaincode %s in tx %d:%d failed\", cc, blockNum, txNum))\n\t}\n","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/common/validation/statebased/v20.go#L123-L159","documentation":"In v20.go's CheckCCEPIfNotChecked, when there is no collection-level policy for the namespace, the chaincode-level endorsement policy (p.ccEP) is evaluated against the endorsement signature set; failure is wrapped with this error, invalidating the transaction.","triggerScenarios":"Validating a transaction whose rwset touches a namespace with no collection EP, where the signature set does not satisfy the chaincode endorsement policy at blockNum:txNum.","commonSituations":"Not enough/mismatched org signatures for the CC EP; CC EP updated via lifecycle while client uses stale discovery results; missing MSP config so an endorsement is unverifiable.","solutions":["Refresh service discovery / chaincode policy info and re-collect endorsements per the current CC EP","Include signatures from every org/principal the endorsement policy requires","Check peer MSP configuration includes all endorsing organizations","Re-endorse after any lifecycle (approve/commit) policy change"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ok, err := policyManager.Evaluate(signatureSet)\nif err != nil || !ok { return errors.New(\"CC EP not satisfied for namespace\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Query the committed CC endorsement policy before endorsing","Include all orgs required by the policy in the endorsement set","Keep peer channel MSP configuration up to date"],"tags":["fabric","endorsement-policy","state-based-validation"],"backgroundTag":"endorsement-policy-failed","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"}