hyperledger/fabric · error

cannot define a new channel with no Consortium value

Error message

cannot define a new channel with no Consortium value

What it means

NewChannelCreateConfigUpdate requires the profile to name the consortium from which the new channel's orgs will be drawn. When conf.Consortium is empty the update could not reference the consortium in the write set, so the library refuses to build a channel-creation ConfigUpdate. The consortium must exist in the system channel's Consortiums group.

Source

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

			return nil, errors.Wrap(err, "failed to create consortium org")
		}
	}

	addValue(consortiumGroup, channelconfig.ChannelCreationPolicyValue(policies.ImplicitMetaAnyPolicy(channelconfig.AdminsPolicyKey).Value()), ordererAdminsPolicyName)

	consortiumGroup.ModPolicy = ordererAdminsPolicyName
	return consortiumGroup, nil
}

// NewChannelCreateConfigUpdate generates a ConfigUpdate which can be sent to the orderer to create a new channel.  Optionally, the channel group of the
// ordering system channel may be passed in, and the resulting ConfigUpdate will extract the appropriate versions from this file.
func NewChannelCreateConfigUpdate(channelID string, conf *genesisconfig.Profile, templateConfig *cb.ConfigGroup) (*cb.ConfigUpdate, error) {
	if conf.Application == nil {
		return nil, errors.New("cannot define a new channel with no Application section")
	}

	if conf.Consortium == "" {
		return nil, errors.New("cannot define a new channel with no Consortium value")
	}

	newChannelGroup, err := NewChannelGroup(conf)
	if err != nil {
		return nil, errors.Wrapf(err, "could not turn parse profile into channel group")
	}

	updt, err := update.Compute(&cb.Config{ChannelGroup: templateConfig}, &cb.Config{ChannelGroup: newChannelGroup})
	if err != nil {
		return nil, errors.Wrapf(err, "could not compute update")
	}

	// Add the consortium name to create the channel for into the write set as required.
	updt.ChannelId = channelID
	updt.ReadSet.Values[channelconfig.ConsortiumKey] = &cb.ConfigValue{Version: 0}
	updt.WriteSet.Values[channelconfig.ConsortiumKey] = &cb.ConfigValue{
		Version: 0,
		Value: protoutil.MarshalOrPanic(&cb.Consortium{

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Add `Consortium: <name>` to the channel-creation profile, matching a consortium defined in the system channel's Consortiums section.
  2. Regenerate the channel-creation transaction with the corrected profile.
  3. Double-check YAML indentation so the Consortium key belongs to the intended profile.

Example fix

# before
MyChannel:
  Application:
    Organizations:
      - *Org1
# after
MyChannel:
  Consortium: SampleConsortium
  Application:
    Organizations:
      - *Org1
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(profile.Consortium) == "" {
    return errors.New("profile.Consortium must name a consortium defined in the system channel")
}

Type guard

func hasConsortium(p *genesisconfig.Profile) bool {
    return p != nil && p.Consortium != ""
}

Try / catch

_, err := encoder.NewChannelCreateConfigUpdate(channelID, profile, template)
if err != nil && strings.Contains(err.Error(), "no Consortium value") {
    return errors.New("add `Consortium: SampleConsortium` to the profile")
}

Prevention

When it happens

Trigger: Calling NewChannelCreateConfigUpdate / MakeChannelCreationTransactionFromTemplate / MakeChannelCreationTransaction with a profile that has an Application section but no Consortium field set in configtx.yaml.

Common situations: Creating an application channel profile in configtx.yaml and forgetting `Consortium: SampleConsortium`; profiles copied from orderer-only templates; typos leaving the field empty after editing.

Related errors


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