{"record":{"id":"a63d959c6036932a","repo":"hyperledger/fabric","slug":"unknown-policy-type-s","errorCode":null,"errorMessage":"unknown policy type: %s","messagePattern":"unknown policy type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/configtxgen/encoder/encoder.go","lineNumber":125,"sourceCode":"\t\t\t\tPolicy: &cb.Policy{\n\t\t\t\t\tType:  int32(cb.Policy_IMPLICIT_META),\n\t\t\t\t\tValue: protoutil.MarshalOrPanic(imp),\n\t\t\t\t},\n\t\t\t}\n\t\tcase SignaturePolicyType:\n\t\t\tsp, err := policydsl.FromString(policy.Rule)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"invalid signature policy rule '%s'\", policy.Rule)\n\t\t\t}\n\t\t\tcg.Policies[policyName] = &cb.ConfigPolicy{\n\t\t\t\tModPolicy: modPolicy,\n\t\t\t\tPolicy: &cb.Policy{\n\t\t\t\t\tType:  int32(cb.Policy_SIGNATURE),\n\t\t\t\t\tValue: protoutil.MarshalOrPanic(sp),\n\t\t\t\t},\n\t\t\t}\n\t\tdefault:\n\t\t\treturn errors.Errorf(\"unknown policy type: %s\", policy.Type)\n\t\t}\n\t}\n\treturn nil\n}\n\n// NewChannelGroup defines the root of the channel configuration.  It defines basic operating principles like the hashing\n// algorithm used for the blocks, as well as the location of the ordering service.  It will recursively call into the\n// NewOrdererGroup, NewConsortiumsGroup, and NewApplicationGroup depending on whether these sub-elements are set in the\n// configuration.  All mod_policy values are set to \"Admins\" for this group, with the exception of the OrdererAddresses\n// value which is set to \"/Channel/Orderer/Admins\".\nfunc NewChannelGroup(conf *genesisconfig.Profile) (*cb.ConfigGroup, error) {\n\tchannelGroup := protoutil.NewConfigGroup()\n\tif err := AddPolicies(channelGroup, conf.Policies, channelconfig.AdminsPolicyKey); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error adding policies to channel group\")\n\t}\n\n\taddValue(channelGroup, channelconfig.HashingAlgorithmValue(), channelconfig.AdminsPolicyKey)\n\taddValue(channelGroup, channelconfig.BlockDataHashingStructureValue(), channelconfig.AdminsPolicyKey)","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/configtxgen/encoder/encoder.go#L107-L143","documentation":"Default branch of AddPolicies' policy-type switch: a policy in the config profile declares a Type that is neither ImplicitMetaPolicyType nor SignaturePolicyType. Since only these two types are supported when encoding channel config, the unknown value (the %s) aborts genesis/channel config generation.","triggerScenarios":"Thrown at internal/configtxgen/encoder/encoder.go:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the policy's type in the profile to ImplicitMeta or Signature, the only supported values in configtx.yaml","Remove or rename the custom policy type entry; arbitrary policy types cannot be expressed via configtxgen","Check for typos such as 'implicitmeta' vs 'ImplicitMeta' in the profile"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}