{"record":{"id":"8e2910d292c47bc0","repo":"hyperledger/fabric","slug":"no-s-policy-in-config-block","errorCode":null,"errorMessage":"no `%s` policy in config block","messagePattern":"no `(.+?)` policy in config block","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/deliverclient/verifier_assembler.go","lineNumber":40,"sourceCode":"\t}\n}\n\n// BlockVerifierAssembler creates a BlockVerifier out of a config envelope\ntype BlockVerifierAssembler struct {\n\tLogger *flogging.FabricLogger\n\tBCCSP  bccsp.BCCSP\n}\n\n// VerifierFromConfig creates a BlockVerifier from the given configuration.\nfunc (bva *BlockVerifierAssembler) VerifierFromConfig(configuration *common.ConfigEnvelope, channel string) (protoutil.BlockVerifierFunc, error) {\n\tbundle, err := channelconfig.NewBundle(channel, configuration.Config, bva.BCCSP)\n\tif err != nil {\n\t\treturn createErrorFunc(err), err\n\t}\n\n\tpolicy, exists := bundle.PolicyManager().GetPolicy(policies.BlockValidation)\n\tif !exists {\n\t\terr := errors.Errorf(\"no `%s` policy in config block\", policies.BlockValidation)\n\t\treturn createErrorFunc(err), err\n\t}\n\n\tbftEnabled := bundle.ChannelConfig().Capabilities().ConsensusTypeBFT()\n\n\tvar consenters []*common.Consenter\n\tif bftEnabled {\n\t\tcfg, ok := bundle.OrdererConfig()\n\t\tif !ok {\n\t\t\terr := errors.New(\"no orderer section in config block\")\n\t\t\treturn createErrorFunc(err), err\n\t\t}\n\t\tconsenters = cfg.Consenters()\n\t}\n\n\treturn protoutil.BlockSignatureVerifier(bftEnabled, consenters, policy), nil\n}\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/deliverclient/verifier_assembler.go#L22-L58","documentation":"VerifierFromConfig builds a block signature verifier from a config bundle and requires the channel's BlockValidation policy (policies.BlockValidation). If the bundle's policy manager does not expose that policy, this error is thrown and a permanently-failing verifier function is returned. It means the config block is not a usable channel config for delivery verification.","triggerScenarios":"Calling VerifierFromConfig with a config envelope whose policy manager has no '/Channel/Application/BlockValidation'-style BlockValidation policy — typically a config block generated without orderer policies or a non-channel (e.g. system-level) config.","commonSituations":"Using configtxgen output where BlockValidation was removed or renamed; passing an orderer system-chain genesis block instead of an application channel config block; upgrading Fabric across versions where policy defaults changed.","solutions":["Regenerate the channel config/genesis block with standard policy defaults (configtxgen with the reference sampleconfig policies).","Inspect the config block (configtxlator) and add a BlockValidation policy under the channel/orderer policies section.","Ensure you pass the application channel's config block, not the ordering system channel or a different block.","Update the peer/orderer to a version matching the channel's policy layout if versions diverged."],"exampleFix":"// before (configtx.yaml missing policy)\nOrderer:\n  Policies:\n    Readers: ...\n    Writers: ...\n// after\nOrderer:\n  Policies:\n    Readers: ...\n    Writers: ...\n    BlockValidation:\n        Type: ImplicitMeta\n        Rule: \"MAJORITY Writers\"","handlingStrategy":"validation","validationCode":"bundle, err := channelconfig.NewBundleFromEnvelope(env)\nif err != nil { return err }\nif _, ok := bundle.PolicyManager().GetPolicy(policies.BlockValidation); !ok {\n    return errors.New(\"config block has no BlockValidation policy; regenerate channel config\")\n}","typeGuard":"func hasBlockValidationPolicy(bundle channelconfig.Resources) bool {\n    _, ok := bundle.PolicyManager().GetPolicy(policies.BlockValidation)\n    return ok\n}","tryCatchPattern":"verifier, err := assembler.VerifierFromConfig(env, chID)\nif err != nil && strings.Contains(err.Error(), \"policy in config block\") {\n    return fmt.Errorf(\"channel %s config is missing BlockValidation policy; regenerate via configtxgen: %w\", chID, err)\n}","preventionTips":["Use standard configtxgen profiles that include all default orderer/channel policies.","Inspect generated genesis blocks with configtxlator before first use.","Distinguish application channel blocks from system channel / orderer genesis blocks.","Test channel config changes in a staging network before updating production channels."],"tags":["hyperledger-fabric","policy","config-block"],"backgroundTag":"missing-policy-in-config","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"}