{"record":{"id":"39f9e3e780814310","repo":"hyperledger/fabric","slug":"policy-s-wasn-t-found","errorCode":null,"errorMessage":"policy %s wasn't found","messagePattern":"policy (.+?) wasn't found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/common/cluster/util.go","lineNumber":498,"sourceCode":"\n// VerifyBlockSignature verifies the signed data associated to a block, optionally with the given config envelope.\nfunc (bv *BlockValidationPolicyVerifier) VerifyBlockSignature(sd []*protoutil.SignedData, envelope *common.ConfigEnvelope) error {\n\tpolicyMgr := bv.PolicyMgr\n\t// If the envelope passed isn't nil, we should use a different policy manager.\n\tif envelope != nil {\n\t\tbundle, err := channelconfig.NewBundle(bv.Channel, envelope.Config, bv.BCCSP)\n\t\tif err != nil {\n\t\t\tbuff := &bytes.Buffer{}\n\t\t\tprotolator.DeepMarshalJSON(buff, envelope.Config)\n\t\t\tbv.Logger.Errorf(\"Failed creating a new bundle for channel %s, Config content is: %s\", bv.Channel, buff.String())\n\t\t\treturn err\n\t\t}\n\t\tbv.Logger.Infof(\"Initializing new PolicyManager for channel %s\", bv.Channel)\n\t\tpolicyMgr = bundle.PolicyManager()\n\t}\n\tpolicy, exists := policyMgr.GetPolicy(policies.BlockValidation)\n\tif !exists {\n\t\treturn errors.Errorf(\"policy %s wasn't found\", policies.BlockValidation)\n\t}\n\treturn policy.EvaluateSignedData(sd)\n}\n\n//go:generate mockery --dir . --name BlockRetriever --case underscore --output ./mocks/\n\n// BlockRetriever retrieves blocks\ntype BlockRetriever interface {\n\t// Block returns a block with the given number,\n\t// or nil if such a block doesn't exist.\n\tBlock(number uint64) *common.Block\n}\n\n// LastConfigBlock returns the last config block relative to the given block.\nfunc LastConfigBlock(block *common.Block, blockRetriever BlockRetriever) (*common.Block, error) {\n\tif block == nil {\n\t\treturn nil, errors.New(\"nil block\")\n\t}","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/common/cluster/util.go#L480-L516","documentation":"VerifyBlockSignature fetches the channel's BlockValidation policy from the (possibly freshly initialized) PolicyManager and evaluates the signed data against it. If the policy is absent, signature verification cannot proceed and this formatted error names the missing policy path.","triggerScenarios":"Calling VerifyBlockSignature on a channel whose config bundle has no policy registered under policies.BlockValidation (/Channel/Orderer/BlockValidation), typically when the channel config lacks the standard policies subtree.","commonSituations":"Channels created from custom/legacy genesis blocks without Policies defined in the Orderer group, or after config updates that accidentally removed the BlockValidation policy.","solutions":["Regenerate or update the channel config to include the Orderer BlockValidation policy (ImplicitMeta MAJORITY Writers is the standard).","Use configtxlator to inspect the current policies and confirm which are missing.","Submit a config update re-adding the missing policy definition.","Verify the channel is on a recent Fabric version where the policy is auto-generated by configtxgen."],"exampleFix":"// configtx.yaml: add to Orderer group\n// Policies:\n//   BlockValidation:\n//     Type: ImplicitMeta\n//     Rule: \"MAJORITY Writers\"","handlingStrategy":"validation","validationCode":"// Confirm the policy exists before evaluating signatures\npm := bundle.PolicyManager()\nif _, exists := pm.GetPolicy(policies.BlockValidation); !exists {\n    return errors.New(\"channel lacks BlockValidation policy\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include the full standard Policies block for the Orderer group in every channel profile.","Review config updates for accidental policy removal via configtxlator diff.","Keep channels on supported Fabric versions where configtxgen emits required policies."],"tags":["fabric","policy","signature-verification"],"backgroundTag":"missing-blockvalidation-policy","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"}