hyperledger/fabric · error

supplied channel creation profile does not contain an applic

Error message

supplied channel creation profile does not contain an application section

What it means

ConfigTemplateFromGroup requires the channel-creation profile to have an Application section, because application orgs are resolved from the consortium into the Application group of the new channel's template. When conf.Application is nil the template cannot be assembled, so this error is returned.

Source

Thrown at internal/configtxgen/encoder/encoder.go:531

		},
	}

	consortiums, ok := template.Groups[channelconfig.ConsortiumsGroupKey]
	if !ok {
		return nil, errors.Errorf("supplied system channel group does not appear to be system channel (missing consortiums group)")
	}

	if consortiums.Groups == nil {
		return nil, errors.Errorf("system channel consortiums group appears to have no consortiums defined")
	}

	consortium, ok := consortiums.Groups[conf.Consortium]
	if !ok {
		return nil, errors.Errorf("supplied system channel group is missing '%s' consortium", conf.Consortium)
	}

	if conf.Application == nil {
		return nil, errors.Errorf("supplied channel creation profile does not contain an application section")
	}

	for _, organization := range conf.Application.Organizations {
		var ok bool
		template.Groups[channelconfig.ApplicationGroupKey].Groups[organization.Name], ok = consortium.Groups[organization.Name]
		if !ok {
			return nil, errors.Errorf("consortium %s does not contain member org %s", conf.Consortium, organization.Name)
		}
	}
	delete(template.Groups, channelconfig.ConsortiumsGroupKey)

	addValue(template, channelconfig.ConsortiumValue(conf.Consortium), channelconfig.AdminsPolicyKey)

	return template, nil
}

// MakeChannelCreationTransaction is a handy utility function for creating transactions for channel creation.
// It assumes the invoker has no system channel context so ignores all but the application section.

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Add an Application section with Organizations to the channel-creation profile in configtx.yaml
  2. Ensure each listed organization is also a member of the referenced Consortium
  3. Regenerate any cached/generated artifacts (genesis block, tx) with configtxgen after the edit

Example fix

// before (configtx.yaml)
ChannelCreationProfile:
  Consortium: SampleConsortium
// after
ChannelCreationProfile:
  Consortium: SampleConsortium
  Application:
    Organizations:
      - Name: Org1
Defensive patterns

Strategy: validation

Validate before calling

// Go: require an Application section before generating the creation transaction
if profile.Application == nil {
    return errors.New("profile must define an Application section with Organizations")
}

Type guard

func hasApplicationSection(p *genesisconfig.Profile) bool { return p != nil && p.Application != nil }

Try / catch

if err != nil {
    if strings.Contains(err.Error(), "does not contain an application section") {
        return fmt.Errorf("add Application.Organizations to the channel profile in configtx.yaml: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Calling MakeChannelCreationTransaction(WithSystemChannelContext) with a Profile whose Application field is nil — i.e. the profile defines a Consortium but no Application/Organizations section in configtx.yaml.

Common situations: A minimal channel profile was written with only Consortium (and maybe Orderer) sections; an orderer-only profile was mistakenly used to create an application channel; configtx.yaml was trimmed and the Application section dropped.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/6c065e90828c5337. Report an issue: GitHub.