{"record":{"id":"d6a5a8f6abc8bf34","repo":"hyperledger/fabric","slug":"1-error-loading-msp-configuration-for-org-s","errorCode":null,"errorMessage":"1 - Error loading MSP configuration for org: %s","messagePattern":"1 - Error loading MSP configuration for org: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/configtxgen/encoder/encoder.go","lineNumber":301,"sourceCode":"\n\t\tconsenterProtos = append(consenterProtos, c)\n\t}\n\treturn consenterProtos, nil\n}\n\n// NewConsortiumOrgGroup returns an org component of the channel configuration.  It defines the crypto material for the\n// organization (its MSP).  It sets the mod_policy of all elements to \"Admins\".\nfunc NewConsortiumOrgGroup(conf *genesisconfig.Organization) (*cb.ConfigGroup, error) {\n\tconsortiumsOrgGroup := protoutil.NewConfigGroup()\n\tconsortiumsOrgGroup.ModPolicy = channelconfig.AdminsPolicyKey\n\n\tif conf.SkipAsForeign {\n\t\treturn consortiumsOrgGroup, nil\n\t}\n\n\tmspConfig, err := msp.GetVerifyingMspConfig(conf.MSPDir, conf.ID, conf.MSPType)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"1 - Error loading MSP configuration for org: %s\", conf.Name)\n\t}\n\n\tif err := AddPolicies(consortiumsOrgGroup, conf.Policies, channelconfig.AdminsPolicyKey); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error adding policies to consortiums org group '%s'\", conf.Name)\n\t}\n\n\taddValue(consortiumsOrgGroup, channelconfig.MSPValue(mspConfig), channelconfig.AdminsPolicyKey)\n\n\treturn consortiumsOrgGroup, nil\n}\n\n// NewOrdererOrgGroup returns an orderer org component of the channel configuration.  It defines the crypto material for the\n// organization (its MSP).  It sets the mod_policy of all elements to \"Admins\".\n// channelCapabilities map[string]bool\nfunc NewOrdererOrgGroup(conf *genesisconfig.Organization, channelCapabilities map[string]bool) (*cb.ConfigGroup, error) {\n\tordererOrgGroup := protoutil.NewConfigGroup()\n\tordererOrgGroup.ModPolicy = channelconfig.AdminsPolicyKey\n","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/configtxgen/encoder/encoder.go#L283-L319","documentation":"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'.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n- &Org1\n  Name: Org1MSP\n  ID: Org1MSP\n  MSPDir: ./crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp\n// after (use the org-level MSP)\n- &Org1\n  Name: Org1MSP\n  ID: Org1MSP\n  MSPDir: ./crypto-config/peerOrganizations/org1.example.com/msp","handlingStrategy":"validation","validationCode":"if conf.MSPDir != \"\" {\n    if info, err := os.Stat(filepath.Join(conf.MSPDir, \"cacerts\")); err != nil || !info.IsDir() {\n        return fmt.Errorf(\"org %s: MSPDir %q is missing cacerts — not a valid org MSP\", conf.Name, conf.MSPDir)\n    }\n}","typeGuard":null,"tryCatchPattern":"if _, err := msp.GetVerifyingMspConfig(conf.MSPDir, conf.ID, conf.MSPType); err != nil {\n    return fmt.Errorf(\"org %s: MSP config at %s failed to load: %w\", conf.Name, conf.MSPDir, err)\n}","preventionTips":["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"],"tags":["hyperledger-fabric","configtxgen","msp","configuration"],"backgroundTag":"msp-config-load-failed","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}