{"record":{"id":"3e6d6116a5bc8fb9","repo":"hyperledger/fabric","slug":"no-channel-configuration-groups-are-available","errorCode":null,"errorMessage":"no channel configuration groups are available","messagePattern":"no channel configuration groups are available","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/util.go","lineNumber":296,"sourceCode":"\t\treturn nil, errors.WithMessage(err, \"malformed configuration block\")\n\t}\n\n\tconfigEnv := &cb.ConfigEnvelope{}\n\t_, err = protoutil.UnmarshalEnvelopeOfType(envelopeConfig, cb.HeaderType_CONFIG, configEnv)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"malformed configuration envelope\")\n\t}\n\n\tif configEnv.Config == nil {\n\t\treturn nil, errors.New(\"no config found in envelope\")\n\t}\n\n\tif configEnv.Config.ChannelGroup == nil {\n\t\treturn nil, errors.New(\"no channel configuration found in the config block\")\n\t}\n\n\tif configEnv.Config.ChannelGroup.Groups == nil {\n\t\treturn nil, errors.New(\"no channel configuration groups are available\")\n\t}\n\n\t_, exists := configEnv.Config.ChannelGroup.Groups[ApplicationGroupKey]\n\tif !exists {\n\t\treturn nil, errors.Errorf(\"invalid configuration block, missing %s configuration group\", ApplicationGroupKey)\n\t}\n\n\tcc, err := NewChannelConfig(configEnv.Config.ChannelGroup, bccsp)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"no valid channel configuration found\")\n\t}\n\treturn cc, nil\n}\n\n// MarshalEtcdRaftMetadata serializes etcd RAFT metadata.\nfunc MarshalEtcdRaftMetadata(md *etcdraft.ConfigMetadata) ([]byte, error) {\n\tcopyMd := proto.Clone(md).(*etcdraft.ConfigMetadata)\n\tfor _, c := range copyMd.Consenters {","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/util.go#L278-L314","documentation":"extractChannelConfig checks that Config.ChannelGroup.Groups (the map of top-level groups like Application, Orderer, Consortiums) is non-nil. This error means a ChannelGroup existed but contained no sub-groups at all, which is never valid for a channel config the callers consume. It is thrown before looking up the Application group so the failure message is precise.","triggerScenarios":"Calling ValidateCapabilities or ExtractMSPIDsForApplicationOrgs with a cb.ConfigEnvelope where Config.ChannelGroup is set but ChannelGroup.Groups is nil — e.g. a Config constructed with only Values/Policies and no Groups map.","commonSituations":"Hand-built test configs that set ChannelGroup but forget Groups; config marshaling that dropped empty Groups maps (proto omitempty); decoding a config from an older/other network format where the group tree was not embedded.","solutions":["Regenerate the config from a valid channel config block so ChannelGroup.Groups contains Application/Orderer groups.","When constructing configs in code/tests, populate ChannelGroup.Groups (use configtx helpers to generate a well-formed group tree).","Check the marshaling path — proto3 zero-valued nested maps may be dropped; ensure the Config was serialized from a populated structure.","Pre-validate in the caller: if configEnv.Config.ChannelGroup.GetGroups() is empty, reject the envelope with your own error."],"exampleFix":"// before\ncg := &cb.ConfigGroup{Values: map[string]*cb.ConfigValue{...}}\nconfig := &cb.Config{ChannelGroup: cg}\n// after\ncg := &cb.ConfigGroup{\n\tValues: map[string]*cb.ConfigValue{...},\n\tGroups: configtx.MakeConfigGroupOrPanic(\"Application\", mspConfig), // populate Groups\n}\nconfig := &cb.Config{ChannelGroup: cg}","handlingStrategy":"validation","validationCode":"func hasGroups(cg *cb.ConfigGroup) bool {\n\treturn cg != nil && len(cg.GetGroups()) > 0\n}\nif !hasGroups(configEnv.Config.ChannelGroup) {\n\treturn errors.New(\"config channel group has no sub-groups\")\n}","typeGuard":"func nonEmptyChannelGroup(c *cb.Config) bool {\n\treturn c != nil && c.ChannelGroup != nil && len(c.ChannelGroup.Groups) > 0\n}","tryCatchPattern":null,"preventionTips":["Populate ChannelGroup.Groups when constructing configs in tests (use configtx helpers)","Be aware proto3 drops empty maps on marshal — never rely on a group with only zero-valued fields","Regenerate configs from real blocks when debugging"],"tags":["hyperledger-fabric","channelconfig","config-groups"],"backgroundTag":"missing-channel-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"}