hyperledger/fabric · error

no MSP found for MSP with ID of %s

Error message

no MSP found for MSP with ID of %s

What it means

The loop validates that every orderer organization in the config has a corresponding MSP instance in the bundle's MSP manager. When an orderer org's MSPID is not a key in msps (returned by GetMSPs), the block's orderer section and channel MSPs are inconsistent, so endpoint/TLS CA extraction aborts.

Source

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

	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...)
	}

	endpointsPerOrg := perOrgEndpoints(ordererConfig, mspIDsToCACerts)
	if len(endpointsPerOrg) > 0 {
		return endpointsPerOrg, nil
	}

	return globalEndpointsFromConfig(aggregatedTLSCerts, bundle), nil
}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Compare org.MSPID() values in the Orderer section against the channel MSP list using configtxlator decode.
  2. Update configtx.yaml so every org in Orderer.Organizations also appears in the channel's Organizations with the identical MSP ID.
  3. Regenerate and submit a config update that adds the missing MSP to the channel config.
  4. Rebuild the genesis block / channel creation transaction from the corrected profile.

Example fix

// before (configtx.yaml)
// Orderer: Organizations: [ - OrdererOrg ]  # Channel missing OrdererOrg
// after
// Channel: Organizations: [ - OrdererOrg ]
// Orderer: Organizations: [ - OrdererOrg ]
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check: every Orderer org MSPID exists in channel MSPs
bundle, err := channelconfig.NewBundleFromEnvelope(env, bccsp)
if err != nil { return err }
msps, _ := bundle.MSPManager().GetMSPs()
for _, org := range bundle.OrdererConfig().Organizations() {
    if _, ok := msps[org.MSPID()]; !ok {
        return fmt.Errorf("org MSP %s missing from channel MSPs", org.MSPID())
    }
}

Prevention

When it happens

Trigger: A config block where an organization under Orderer: -> Organizations declares an MSP ID that does not appear in the channel's MSPs (Channels: -> Organizations or Consortiums), typically after renaming an MSP ID in one place but not the other.

Common situations: configtx.yaml where Orderer.Organizations lists an org not included in the channel's Organizations, MSP ID renamed during a config update in only one section, or mixing config blocks from different networks.

Related errors


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