{"record":{"id":"0f0f9509987e87b1","repo":"hyperledger/fabric","slug":"invalid-configuration-block-missing-s-configurat","errorCode":null,"errorMessage":"invalid configuration block, missing %s configuration group","messagePattern":"invalid configuration block, missing (.+?) configuration group","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/util.go","lineNumber":301,"sourceCode":"\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 {\n\t\t// Expect the user to set the config value for client/server certs to the\n\t\t// path where they are persisted locally, then load these files to memory.\n\t\tclientCert, err := os.ReadFile(string(c.GetClientTlsCert()))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot load client cert for consenter %s:%d: %s\", c.GetHost(), c.GetPort(), err)","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/util.go#L283-L319","documentation":"After confirming the group map exists, extractChannelConfig requires the top-level Application group because both ValidateCapabilities and ExtractMSPIDsForApplicationOrgs operate on application-organization config. This formatted error reports which named group key is missing from ChannelGroup.Groups. ApplicationGroupKey is 'Application'.","triggerScenarios":"Calling ValidateCapabilities or ExtractMSPIDsForApplicationOrgs on a config envelope whose ChannelGroup.Groups lacks the 'Application' key — e.g. an Orderer-only (system channel) config, or a config for a consortium channel fetched via the wrong path.","commonSituations":"Pointing tooling at the system channel / orderer config block instead of an application channel's config block; stripping the Application group when building configs programmatically; using a consortium-level config where only Orderer and Consortiums groups exist.","solutions":["Use the config block of an application channel (e.g. peer channel fetch config on the right channel), not the system channel or orderer genesis block.","Add/populate ChannelGroup.Groups[\"Application\"] when constructing the config programmatically.","Confirm you are not passing a config extracted from a Consortiums or Orderer subtree as a full channel config.","Pre-check the groups map for channelconfig.ApplicationGroupKey before invoking and produce a targeted error."],"exampleFix":"// before\nblock := fetchBlock(\"system\") // system channel config\nerr := ExtractMSPIDsForApplicationOrgs(env)\n// after\nblock := fetchBlock(\"mychannel\") // application channel config\nerr := ExtractMSPIDsForApplicationOrgs(env)","handlingStrategy":"validation","validationCode":"import \"github.com/hyperledger/fabric/common/channelconfig\"\n\nfunc hasApplicationGroup(c *cb.Config) bool {\n\t_, ok := c.ChannelGroup.Groups[channelconfig.ApplicationGroupKey]\n\treturn ok\n}\nif !hasApplicationGroup(configEnv.Config) {\n\treturn errors.New(\"config is not an application channel config\")\n}","typeGuard":"func isAppChannelConfig(c *cb.Config) bool {\n\treturn c != nil && c.ChannelGroup != nil && c.ChannelGroup.Groups != nil && c.ChannelGroup.Groups[\"Application\"] != nil\n}","tryCatchPattern":null,"preventionTips":["Fetch config from the application channel (`peer channel fetch config <channel>`), not the system channel","Check for the 'Application' group before invoking application-focused APIs","Keep system-channel and application-channel config handling in separate code paths"],"tags":["hyperledger-fabric","channelconfig","application-group"],"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"}