{"record":{"id":"be924149bee8319f","repo":"hyperledger/fabric","slug":"error-adding-policies-to-application-group","errorCode":null,"errorMessage":"error adding policies to application group","messagePattern":"error adding policies to application group","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/configtxgen/encoder/encoder.go","lineNumber":349,"sourceCode":"\t}\n\n\taddValue(ordererOrgGroup, channelconfig.MSPValue(mspConfig), channelconfig.AdminsPolicyKey)\n\n\tif len(conf.OrdererEndpoints) > 0 {\n\t\taddValue(ordererOrgGroup, channelconfig.EndpointsValue(conf.OrdererEndpoints), channelconfig.AdminsPolicyKey)\n\t} else if channelCapabilities[\"V3_0\"] {\n\t\treturn nil, errors.Errorf(\"orderer endpoints for organization %s are missing and must be configured when capability V3_0 is enabled\", conf.Name)\n\t}\n\n\treturn ordererOrgGroup, nil\n}\n\n// NewApplicationGroup returns the application component of the channel configuration.  It defines the organizations which are involved\n// in application logic like chaincodes, and how these members may interact with the orderer.  It sets the mod_policy of all elements to \"Admins\".\nfunc NewApplicationGroup(conf *genesisconfig.Application) (*cb.ConfigGroup, error) {\n\tapplicationGroup := protoutil.NewConfigGroup()\n\tif err := AddPolicies(applicationGroup, conf.Policies, channelconfig.AdminsPolicyKey); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error adding policies to application group\")\n\t}\n\n\tif len(conf.ACLs) > 0 {\n\t\taddValue(applicationGroup, channelconfig.ACLValues(conf.ACLs), channelconfig.AdminsPolicyKey)\n\t}\n\n\tif len(conf.Capabilities) > 0 {\n\t\taddValue(applicationGroup, channelconfig.CapabilitiesValue(conf.Capabilities), channelconfig.AdminsPolicyKey)\n\t}\n\n\tfor _, org := range conf.Organizations {\n\t\tvar err error\n\t\tapplicationGroup.Groups[org.Name], err = NewApplicationOrgGroup(org)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to create application org\")\n\t\t}\n\t}\n","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/configtxgen/encoder/encoder.go#L331-L367","documentation":"Wrapping error in NewApplicationGroup: AddPolicies failed while installing the application-group policies (Readers/Writers/Admins/LifecycleEndorsement/Endorsement). The wrapped error is typically an invalid policy rule string or unknown policy type declared in the profile's Application.Policies.","triggerScenarios":"Thrown at internal/configtxgen/encoder/encoder.go:349 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the policy Rule strings or Type values in the profile's Application.Policies per the wrapped error","Use valid ImplicitMeta rules like \"MAJORITY Endorsement\" or signature-policy DSL","Keep the standard policy set for application groups unless custom policies are required"],"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"}