{"record":{"id":"760d87692ba6d60d","repo":"hyperledger/fabric","slug":"channel-template-configs-must-contain-an-applicati","errorCode":null,"errorMessage":"channel template configs must contain an application section","messagePattern":"channel template configs must contain an application section","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/configtxgen/encoder/encoder.go","lineNumber":494,"sourceCode":"\t\tValue: protoutil.MarshalOrPanic(&cb.Consortium{\n\t\t\tName: conf.Consortium,\n\t\t}),\n\t}\n\n\treturn updt, nil\n}\n\n// DefaultConfigTemplate generates a config template based on the assumption that\n// the input profile is a channel creation template and no system channel context\n// is available.\nfunc DefaultConfigTemplate(conf *genesisconfig.Profile) (*cb.ConfigGroup, error) {\n\tchannelGroup, err := NewChannelGroup(conf)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"error parsing configuration\")\n\t}\n\n\tif _, ok := channelGroup.Groups[channelconfig.ApplicationGroupKey]; !ok {\n\t\treturn nil, errors.New(\"channel template configs must contain an application section\")\n\t}\n\n\tchannelGroup.Groups[channelconfig.ApplicationGroupKey].Values = nil\n\tchannelGroup.Groups[channelconfig.ApplicationGroupKey].Policies = nil\n\n\treturn channelGroup, nil\n}\n\nfunc ConfigTemplateFromGroup(conf *genesisconfig.Profile, cg *cb.ConfigGroup) (*cb.ConfigGroup, error) {\n\ttemplate := proto.Clone(cg).(*cb.ConfigGroup)\n\tif template.Groups == nil {\n\t\treturn nil, errors.Errorf(\"supplied system channel group has no sub-groups\")\n\t}\n\n\ttemplate.Groups[channelconfig.ApplicationGroupKey] = &cb.ConfigGroup{\n\t\tGroups: map[string]*cb.ConfigGroup{},\n\t\tPolicies: map[string]*cb.ConfigPolicy{\n\t\t\tchannelconfig.AdminsPolicyKey: {},","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/configtxgen/encoder/encoder.go#L476-L512","documentation":"DefaultConfigTemplate builds a channel-creation template by stripping values/policies from the Application group of a full channel group. It requires the generated channel group to contain an Application sub-group; if absent the profile cannot serve as a channel-creation template and this error is thrown.","triggerScenarios":"Calling DefaultConfigTemplate with a profile whose NewChannelGroup output lacks the Application group — i.e. a profile with no valid Application section (orderer-only or consortium-style profile).","commonSituations":"Using the system channel profile or an orderer-only profile where an application-channel profile is expected for MakeChannelCreationTransaction / outputCreateChannelTx.","solutions":["Use a profile that defines an Application section with at least one organization.","Point --profile at the intended application-channel profile in configtx.yaml.","Verify the Application group survives encoding (no errors silently skipping it)."],"exampleFix":"# before\nProfile:\n  OrdererGenesis:   # system channel profile mistakenly reused\n    ...\n# after\nProfile:\n  MyChannel:\n    Consortium: SampleConsortium\n    Application:\n      Organizations:\n        - *Org1","handlingStrategy":"validation","validationCode":"if profile.Application == nil {\n    return errors.New(\"DefaultConfigTemplate requires a profile with an Application section\")\n}","typeGuard":"func isAppChannelProfile(p *genesisconfig.Profile) bool {\n    return p != nil && p.Application != nil\n}","tryCatchPattern":"tmpl, err := encoder.DefaultConfigTemplate(profile)\nif err != nil && strings.Contains(err.Error(), \"must contain an application section\") {\n    return errors.New(\"switch to an application-channel profile\")\n}","preventionTips":["Use system channel profiles only for genesis generation, not channel templates.","Assert profile.Application != nil in deployment tooling before calling template APIs.","Document which profiles in configtx.yaml are channel-creation profiles."],"tags":["hyperledger-fabric","configtx","template","application-section"],"backgroundTag":"missing-config-section","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"}