hyperledger/fabric · error

Disallowed channel group: %s

Error message

Disallowed channel group: %s

What it means

NewChannelConfig only accepts four sub-groups under the Channel group: Application, Orderer, Consortiums (and skips others it handles); any other group name hits the default case and returns "Disallowed channel group: %s". It guards against unknown or misspelled groups being smuggled into channel configuration, which would otherwise be silently ignored.

Source

Thrown at common/channelconfig/channel.go:111

	channelCapabilities := cc.Capabilities()

	if err := cc.Validate(channelCapabilities); err != nil {
		return nil, err
	}

	mspConfigHandler := NewMSPConfigHandler(channelCapabilities.MSPVersion(), bccsp)

	var err error
	for groupName, group := range channelGroup.Groups {
		switch groupName {
		case ApplicationGroupKey:
			cc.appConfig, err = NewApplicationConfig(group, mspConfigHandler)
		case OrdererGroupKey:
			cc.ordererConfig, err = NewOrdererConfig(group, mspConfigHandler, channelCapabilities)
		case ConsortiumsGroupKey:
			cc.consortiumsConfig, err = NewConsortiumsConfig(group, mspConfigHandler)
		default:
			return nil, fmt.Errorf("Disallowed channel group: %s", group)
		}
		if err != nil {
			return nil, errors.Wrapf(err, "could not create channel %s sub-group config", groupName)
		}
	}

	if cc.mspManager, err = mspConfigHandler.CreateMSPManager(); err != nil {
		return nil, err
	}

	return cc, nil
}

// MSPManager returns the MSP manager for this config
func (cc *ChannelConfig) MSPManager() msp.MSPManager {
	return cc.mspManager
}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Rename the offending group to one of the allowed keys (Application, Orderer, Consortiums) or delete it from the config
  2. Regenerate the config with configtxgen to guarantee only recognized groups appear
  3. Check group names case-sensitively in the decoded config (`configtxlator proto_decode`) before submitting

Example fix

// before
config.ChannelGroup.Groups["Orderers"] = &cb.ConfigGroup{} // disallowed

// after
config.ChannelGroup.Groups["Orderer"] = &cb.ConfigGroup{} // allowed key
Defensive patterns

Strategy: validation

Validate before calling

var allowedChannelGroups = map[string]bool{"Application": true, "Orderer": true, "Consortiums": true}
for name := range channelGroup.Groups {
    if !allowedChannelGroups[name] {
        return fmt.Errorf("pre-check: disallowed channel group %q", name)
    }
}

Try / catch

cc, err := channelconfig.NewChannelConfig(channelGroup, bccsp)
if err != nil {
    if strings.HasPrefix(err.Error(), "Disallowed channel group") {
        return fmt.Errorf("remove or rename the unknown group before retrying: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Iterating channelGroup.Groups where a key is not ApplicationGroupKey, OrdererGroupKey, or ConsortiumsGroupKey — e.g. a group named "orderer" (wrong case), "Consortium", "Peer", or a leftover group from config edits.

Common situations: Hand-editing decoded configtxlator output and adding a custom group; misspelling a standard group key; fabricating config envelopes in tests with arbitrary group names; tooling that merges unrelated config groups into the channel group.

Related errors


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