hyperledger/fabric · error

1 - Error loading MSP configuration for org: %s

Error message

1 - Error loading MSP configuration for org: %s

What it means

NewConsortiumOrgGroup builds the MSP config for an organization inside a consortium. It calls msp.GetVerifyingMspConfig on conf.MSPDir/conf.ID/conf.MSPType; any failure reading or parsing the MSP directory is wrapped as '1 - Error loading MSP configuration for org'.

Source

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

		consenterProtos = append(consenterProtos, c)
	}
	return consenterProtos, nil
}

// NewConsortiumOrgGroup returns an org component of the channel configuration.  It defines the crypto material for the
// organization (its MSP).  It sets the mod_policy of all elements to "Admins".
func NewConsortiumOrgGroup(conf *genesisconfig.Organization) (*cb.ConfigGroup, error) {
	consortiumsOrgGroup := protoutil.NewConfigGroup()
	consortiumsOrgGroup.ModPolicy = channelconfig.AdminsPolicyKey

	if conf.SkipAsForeign {
		return consortiumsOrgGroup, nil
	}

	mspConfig, err := msp.GetVerifyingMspConfig(conf.MSPDir, conf.ID, conf.MSPType)
	if err != nil {
		return nil, errors.Wrapf(err, "1 - Error loading MSP configuration for org: %s", conf.Name)
	}

	if err := AddPolicies(consortiumsOrgGroup, conf.Policies, channelconfig.AdminsPolicyKey); err != nil {
		return nil, errors.Wrapf(err, "error adding policies to consortiums org group '%s'", conf.Name)
	}

	addValue(consortiumsOrgGroup, channelconfig.MSPValue(mspConfig), channelconfig.AdminsPolicyKey)

	return consortiumsOrgGroup, nil
}

// NewOrdererOrgGroup returns an orderer org component of the channel configuration.  It defines the crypto material for the
// organization (its MSP).  It sets the mod_policy of all elements to "Admins".
// channelCapabilities map[string]bool
func NewOrdererOrgGroup(conf *genesisconfig.Organization, channelCapabilities map[string]bool) (*cb.ConfigGroup, error) {
	ordererOrgGroup := protoutil.NewConfigGroup()
	ordererOrgGroup.ModPolicy = channelconfig.AdminsPolicyKey

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Point the org's MSPDir in configtx.yaml at the organization's MSP directory (the one containing config.yaml/ca.crt), not a peer/orderer user MSP.
  2. Regenerate or copy the crypto material so the referenced MSPDir is complete.
  3. Set SkipAsForeign: true for orgs whose MSP material is not available on this machine (configtxgen then skips loading it).
  4. Confirm MSPType matches the material (default bccsp/'fabric'); remove or fix an incorrect msp type in the config.

Example fix

// before
- &Org1
  Name: Org1MSP
  ID: Org1MSP
  MSPDir: ./crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
// after (use the org-level MSP)
- &Org1
  Name: Org1MSP
  ID: Org1MSP
  MSPDir: ./crypto-config/peerOrganizations/org1.example.com/msp
Defensive patterns

Strategy: validation

Validate before calling

if conf.MSPDir != "" {
    if info, err := os.Stat(filepath.Join(conf.MSPDir, "cacerts")); err != nil || !info.IsDir() {
        return fmt.Errorf("org %s: MSPDir %q is missing cacerts — not a valid org MSP", conf.Name, conf.MSPDir)
    }
}

Try / catch

if _, err := msp.GetVerifyingMspConfig(conf.MSPDir, conf.ID, conf.MSPType); err != nil {
    return fmt.Errorf("org %s: MSP config at %s failed to load: %w", conf.Name, conf.MSPDir, err)
}

Prevention

When it happens

Trigger: Calling NewConsortiumOrgGroup (via NewConsortiumGroup or configtxgen) where the org's MSPDir does not exist, lacks ca.crt/signcerts/keystore structure, MSPType is unsupported (e.g. 'idemix' without proper material), or the MSP contents do not match the org ID.

Common situations: Wrong MSPDir in configtx.yaml; using an admin/signcert folder instead of the org MSP folder; org marked SkipAsForeign=false but its MSP files were never generated; Fabric v2 removing the old bccspMsp defaults mismatch; typo in MSPType.

Related errors


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