{"record":{"id":"8dfe570e9ccf90b5","repo":"hyperledger/fabric","slug":"could-not-create-channel-s-sub-group-config","errorCode":null,"errorMessage":"could not create channel %s sub-group config","messagePattern":"could not create channel (.+?) sub-group config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/channel.go","lineNumber":114,"sourceCode":"\t\treturn nil, err\n\t}\n\n\tmspConfigHandler := NewMSPConfigHandler(channelCapabilities.MSPVersion(), bccsp)\n\n\tvar err error\n\tfor groupName, group := range channelGroup.Groups {\n\t\tswitch groupName {\n\t\tcase ApplicationGroupKey:\n\t\t\tcc.appConfig, err = NewApplicationConfig(group, mspConfigHandler)\n\t\tcase OrdererGroupKey:\n\t\t\tcc.ordererConfig, err = NewOrdererConfig(group, mspConfigHandler, channelCapabilities)\n\t\tcase ConsortiumsGroupKey:\n\t\t\tcc.consortiumsConfig, err = NewConsortiumsConfig(group, mspConfigHandler)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"Disallowed channel group: %s\", group)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"could not create channel %s sub-group config\", groupName)\n\t\t}\n\t}\n\n\tif cc.mspManager, err = mspConfigHandler.CreateMSPManager(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cc, nil\n}\n\n// MSPManager returns the MSP manager for this config\nfunc (cc *ChannelConfig) MSPManager() msp.MSPManager {\n\treturn cc.mspManager\n}\n\n// OrdererConfig returns the orderer config associated with this channel\nfunc (cc *ChannelConfig) OrdererConfig() *OrdererConfig {\n\treturn cc.ordererConfig","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/channel.go#L96-L132","documentation":"This is a wrapping error from NewChannelConfig: whichever sub-config constructor (NewApplicationConfig, NewOrdererConfig, or NewConsortiumsConfig) returned a failure is wrapped as \"could not create channel %s sub-group config\". The inner error carries the real cause (e.g. missing policies, bad MSP config, invalid orderer addresses), and %s names the failing group.","triggerScenarios":"NewChannelConfig iterating Groups where a case calls one of the sub-config constructors and it returns err != nil — e.g. invalid Consortiums definition, bad orderer configuration (TLS/Kafka settings), or malformed MSP metadata in the application/orderer group.","commonSituations":"Malformed configtx.yaml sections (invalid Policies, wrong Organizations refs); orderer group referencing nonexistent consensus type settings; consortium definitions referencing organizations not defined in the channel; v1.4→v2.x config migrations with stale fields.","solutions":["Read the wrapped inner error to find the real failure, then fix that sub-config (application/orderer/consortiums)","Validate configtx.yaml with `configtxgen -printOrg` / config generation and fix the named section","Decode the failing config with configtxlator and inspect the named group's values and policies","Ensure all referenced organizations and policies exist and are well-formed in the group"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-validate referenced orgs/policies exist before constructing\nfor gname, group := range channelGroup.Groups {\n    if group.Policies == nil || len(group.Policies) == 0 {\n        return fmt.Errorf(\"group %s has no policies\", gname)\n    }\n}","typeGuard":null,"tryCatchPattern":"cc, err := channelconfig.NewChannelConfig(channelGroup, bccsp)\nif err != nil {\n    if strings.Contains(err.Error(), \"sub-group config\") {\n        // surface the wrapped inner error for the real fix\n        return fmt.Errorf(\"sub-group construction failed: %w\", errors.Unwrap(err))\n    }\n    return err\n}","preventionTips":["Always unwrap/log the inner error — this message alone never names the real cause","Validate the relevant configtx.yaml section (Orderer/Application/Consortiums) with configtxgen before deploying","Ensure every referenced organization and policy is defined in the config"],"tags":["fabric","channelconfig","nested-error","validation"],"backgroundTag":"nested-config-validation-failed","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"}