{"record":{"id":"63ffbc0264e74e44","repo":"hyperledger/fabric","slug":"error-adding-policies-to-application-org-group-s","errorCode":null,"errorMessage":"error adding policies to application org group %s","messagePattern":"error adding policies to application org group (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/configtxgen/encoder/encoder.go","lineNumber":388,"sourceCode":"}\n\n// NewApplicationOrgGroup returns an application org component of the channel configuration.  It defines the crypto material for the organization\n// (its MSP) as well as its anchor peers for use by the gossip network.  It sets the mod_policy of all elements to \"Admins\".\nfunc NewApplicationOrgGroup(conf *genesisconfig.Organization) (*cb.ConfigGroup, error) {\n\tapplicationOrgGroup := protoutil.NewConfigGroup()\n\tapplicationOrgGroup.ModPolicy = channelconfig.AdminsPolicyKey\n\n\tif conf.SkipAsForeign {\n\t\treturn applicationOrgGroup, nil\n\t}\n\n\tmspConfig, err := msp.GetVerifyingMspConfig(conf.MSPDir, conf.ID, conf.MSPType)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"1 - Error loading MSP configuration for org %s\", conf.Name)\n\t}\n\n\tif err := AddPolicies(applicationOrgGroup, conf.Policies, channelconfig.AdminsPolicyKey); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error adding policies to application org group %s\", conf.Name)\n\t}\n\taddValue(applicationOrgGroup, channelconfig.MSPValue(mspConfig), channelconfig.AdminsPolicyKey)\n\n\tvar anchorProtos []*pb.AnchorPeer\n\tfor _, anchorPeer := range conf.AnchorPeers {\n\t\tanchorProtos = append(anchorProtos, &pb.AnchorPeer{\n\t\t\tHost: anchorPeer.Host,\n\t\t\tPort: int32(anchorPeer.Port),\n\t\t})\n\t}\n\n\t// Avoid adding an unnecessary anchor peers element when one is not required.  This helps\n\t// prevent a delta from the orderer system channel when computing more complex channel\n\t// creation transactions\n\tif len(anchorProtos) > 0 {\n\t\taddValue(applicationOrgGroup, channelconfig.AnchorPeersValue(anchorProtos), channelconfig.AdminsPolicyKey)\n\t}\n","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/configtxgen/encoder/encoder.go#L370-L406","documentation":"Wrapping error in NewApplicationOrgGroup: AddPolicies failed for the application org group named %s. The org's declared policies (typically Readers/Writers/Admins) have an invalid rule or unsupported type; the wrapped error names the exact policy problem.","triggerScenarios":"Thrown at internal/configtxgen/encoder/encoder.go:388 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the organization's policy Rule/Type values in configtx.yaml per the wrapped error","Use standard ImplicitMeta rules (e.g. \"MAJORITY Endorsement\") unless signature policies are required","Ensure org policies reference valid policy sub-policies and principal names"],"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"}