hyperledger/fabric · error

failed obtaining orderer config from bundle

Error message

failed obtaining orderer config from bundle

What it means

After building the bundle, EndpointconfigFromConfigBlock calls bundle.OrdererConfig(). This returns ok=false when the channel configuration does not contain a valid Orderer config group, so the function cannot enumerate orderer organizations and their TLS CA certs.

Source

Thrown at orderer/common/cluster/util.go:335

	if block == nil {
		return nil, errors.New("nil block")
	}
	envelopeConfig, err := protoutil.ExtractEnvelope(block, 0)
	if err != nil {
		return nil, err
	}

	bundle, err := channelconfig.NewBundleFromEnvelope(envelopeConfig, bccsp)
	if err != nil {
		return nil, errors.Wrap(err, "failed extracting bundle from envelope")
	}
	msps, err := bundle.MSPManager().GetMSPs()
	if err != nil {
		return nil, errors.Wrap(err, "failed obtaining MSPs from MSPManager")
	}
	ordererConfig, ok := bundle.OrdererConfig()
	if !ok {
		return nil, errors.New("failed obtaining orderer config from bundle")
	}

	mspIDsToCACerts := make(map[string][][]byte)
	var aggregatedTLSCerts [][]byte
	for _, org := range ordererConfig.Organizations() {
		// Validate that every orderer org has a corresponding MSP instance in the MSP Manager.
		msp, exists := msps[org.MSPID()]
		if !exists {
			return nil, errors.Errorf("no MSP found for MSP with ID of %s", org.MSPID())
		}

		// Build a per org mapping of the TLS CA certs for this org,
		// and aggregate all TLS CA certs into aggregatedTLSCerts to be used later on.
		var caCerts [][]byte
		caCerts = append(caCerts, msp.GetTLSIntermediateCerts()...)
		caCerts = append(caCerts, msp.GetTLSRootCerts()...)
		mspIDsToCACerts[org.MSPID()] = caCerts
		aggregatedTLSCerts = append(aggregatedTLSCerts, caCerts...)

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Verify the block passed is actually a config block (type_header type CONFIG) for the correct channel.
  2. Regenerate the genesis/channel config ensuring the Orderer section with orderer organizations is present in configtx.yaml.
  3. Check that the channel was created with a profile that includes Orderer: -> Organizations entries.
  4. Ensure the orderer is joining the intended channel and not one configured by another network.
Defensive patterns

Strategy: validation

Validate before calling

// Confirm block is a config block of the expected channel before use
if !protoutil.IsConfigBlock(block) {
    return errors.New("block is not a config block")
}

Type guard

func isConfigBlock(b *common.Block) bool {
    return b != nil && b.Header != nil && protoutil.IsConfigBlock(b)
}

Prevention

When it happens

Trigger: Passing a config block from a channel whose config has no Orderer group (e.g. an application channel block missing the Orderer section, or a non-config block mistakenly passed in), so bundle.OrdererConfig() returns false.

Common situations: Pointing an orderer's cluster/block-puller at the genesis block of the wrong channel type, channel created without orderer orgs, or passing a regular (non-config) block where a config block was expected.

Related errors


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