{"record":{"id":"fd0f396ed1c7e647","repo":"hyperledger/fabric","slug":"validation-of-endorsement-policy-for-chaincode-s","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/v13.go","lineNumber":61,"sourceCode":"/**********************************************************************************************************/\n/**********************************************************************************************************/\n\ntype policyCheckerV13 struct {\n\tsomeEPChecked bool\n\tccEPChecked   bool\n\tpolicySupport validation.PolicyEvaluator\n\tccEP          []byte\n}\n\nfunc (p *policyCheckerV13) checkCCEPIfCondition(cc string, blockNum, txNum uint64, condition bool, sd []*protoutil.SignedData) commonerrors.TxValidationError {\n\tif condition {\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\n\tp.ccEPChecked = true\n\tp.someEPChecked = true\n\treturn nil\n}\n\nfunc (p *policyCheckerV13) CheckCCEPIfNotChecked(cc, coll string, blockNum, txNum uint64, sd []*protoutil.SignedData) commonerrors.TxValidationError {\n\treturn p.checkCCEPIfCondition(cc, blockNum, txNum, p.ccEPChecked, sd)\n}\n\nfunc (p *policyCheckerV13) CheckCCEPIfNoEPChecked(cc string, blockNum, txNum uint64, sd []*protoutil.SignedData) commonerrors.TxValidationError {\n\treturn p.checkCCEPIfCondition(cc, blockNum, txNum, p.someEPChecked, sd)\n}\n\nfunc (p *policyCheckerV13) SBEPChecked() {\n\tp.someEPChecked = true\n}","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/common/validation/statebased/v13.go#L43-L79","documentation":"In state-based (key-level) endorsement validation (v1.3 validator), checkCCEPIfCondition evaluates the chaincode endorsement policy against the transaction's endorsement signature set via policySupport.Evaluate. When the signatures don't satisfy the chaincode-level endorsement policy it wraps the error with this message and flags it as a policy error (tx marked invalid).","triggerScenarios":"CheckCCEPIfNotChecked/CheckCCEPIfNoEPChecked called during tx validation where the endorsement signature set fails the chaincode's endorsement policy (p.ccEP) for the given block/tx number.","commonSituations":"Endorsements collected from peers that don't satisfy the CC endorsement policy; endorsement policy changed via lifecycle after endorsements were collected; a new endorsing org's signature missing after policy update; peers with outdated CC or MSP missing the endorsing org.","solutions":["Collect endorsements satisfying the current chaincode endorsement policy (check `peer chaincode list` / policy definition)","Re-endorse the transaction after any endorsement-policy update","Ensure all endorsing orgs' MSPs are configured on the peer validating the tx","Verify endorsers are running the same chaincode version as required"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ok, err := policyManager.Evaluate(signatureSet)\nif err != nil || !ok { return errors.New(\"signatures do not satisfy CC endorsement policy\") }","typeGuard":null,"tryCatchPattern":"err := validator.Validate(block, policy)\nvar perr *validationpolicy.Error\nif errors.As(err, &perr) && strings.Contains(perr.Error(), \"validation of endorsement policy for chaincode\") {\n\t// tx will be marked invalid: re-endorse with required orgs\n}","preventionTips":["Refresh discovery results before each endorsement round","Re-endorse immediately after any CC endorsement policy update","Ensure peer MSPs contain all endorsing organizations"],"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"}