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
- 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.
- Regenerate or copy the crypto material so the referenced MSPDir is complete.
- Set SkipAsForeign: true for orgs whose MSP material is not available on this machine (configtxgen then skips loading it).
- 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
- Point MSPDir at the org-level MSP (contains config.yaml and cacerts), not a user/node MSP
- Run cryptogen generate before configtxgen so material exists
- Set SkipAsForeign: true for orgs whose material is not present on the host
- Check MSPDir readability and ownership, especially in container mounts
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
- could not get msp for channel [%s]
- failed getting local MSP principal during channelless check
- error adding policies to consortiums org group '%s'
- supplied system channel group is missing '%s' consortium
- supplied channel creation profile does not contain an applic
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/d6a5a8f6abc8bf34.
Report an issue: GitHub.