{"record":{"id":"3de7f7764d65a44e","repo":"hyperledger/fabric","slug":"failed-to-create-consortium-org","errorCode":null,"errorMessage":"failed to create consortium org","messagePattern":"failed to create consortium org","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/configtxgen/encoder/encoder.go","lineNumber":440,"sourceCode":"\t\t\treturn nil, errors.Wrapf(err, \"failed to create consortium %s\", consortiumName)\n\t\t}\n\t}\n\n\tconsortiumsGroup.ModPolicy = ordererAdminsPolicyName\n\treturn consortiumsGroup, nil\n}\n\n// NewConsortiumGroup returns a consortium component of the channel configuration. Each consortium defines the organizations which may be involved in channel\n// creation, as well as the channel creation policy the orderer checks at channel creation time to authorize the action. It sets the mod_policy of all\n// elements to \"/Channel/Orderer/Admins\".\nfunc NewConsortiumGroup(conf *genesisconfig.Consortium) (*cb.ConfigGroup, error) {\n\tconsortiumGroup := protoutil.NewConfigGroup()\n\n\tfor _, org := range conf.Organizations {\n\t\tvar err error\n\t\tconsortiumGroup.Groups[org.Name], err = NewConsortiumOrgGroup(org)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to create consortium org\")\n\t\t}\n\t}\n\n\taddValue(consortiumGroup, channelconfig.ChannelCreationPolicyValue(policies.ImplicitMetaAnyPolicy(channelconfig.AdminsPolicyKey).Value()), ordererAdminsPolicyName)\n\n\tconsortiumGroup.ModPolicy = ordererAdminsPolicyName\n\treturn consortiumGroup, nil\n}\n\n// NewChannelCreateConfigUpdate generates a ConfigUpdate which can be sent to the orderer to create a new channel.  Optionally, the channel group of the\n// ordering system channel may be passed in, and the resulting ConfigUpdate will extract the appropriate versions from this file.\nfunc NewChannelCreateConfigUpdate(channelID string, conf *genesisconfig.Profile, templateConfig *cb.ConfigGroup) (*cb.ConfigUpdate, error) {\n\tif conf.Application == nil {\n\t\treturn nil, errors.New(\"cannot define a new channel with no Application section\")\n\t}\n\n\tif conf.Consortium == \"\" {\n\t\treturn nil, errors.New(\"cannot define a new channel with no Consortium value\")","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/configtxgen/encoder/encoder.go#L422-L458","documentation":"NewConsortiumGroup wraps errors from NewConsortiumOrgGroup while building the org sub-groups of a single consortium. It means one of the organizations listed in the consortium could not be converted into a config group (usually an invalid MSP/org definition). The consortium-level wrapper loses the org name; inspect the innermost error for the specific reason.","triggerScenarios":"Any call chain NewConsortiumsGroup -> NewConsortiumGroup -> NewConsortiumOrgGroup where an org in conf.Organizations fails encoding — e.g. NewConsortiumOrgGroup returns an error for a nil/invalid org, missing MSPDir, or invalid endpoint/anchor config.","commonSituations":"Typo in an org anchor in configtx.yaml, an org referenced in the consortium defined without a valid MSPDir/ID, or an org YAML section failing unmarshalling into genesisconfig.Organization.","solutions":["Inspect the innermost wrapped error to find the failing org and fix its definition (MSPDir, ID, Name).","Ensure every org in the consortium's Organizations list is declared and spelled correctly under the profile's Organizations section.","Validate the MSP directory exists and contains valid signing/admin certs before generating genesis material."],"exampleFix":"// before\n- &Org3\n  Name: Org3\n  # MSPDir missing\n// after\n- &Org3\n  Name: Org3\n  ID: Org3MSP\n  MSPDir: crypto-config/peerOrganizations/org3.example.com/msp","handlingStrategy":"validation","validationCode":"for _, org := range consortium.Organizations {\n    if org == nil || org.Name == \"\" || org.ID == \"\" || org.MSPDir == \"\" {\n        return fmt.Errorf(\"consortium org invalid: %+v\", org)\n    }\n    if _, err := os.Stat(org.MSPDir); err != nil {\n        return fmt.Errorf(\"MSPDir %q missing: %w\", org.MSPDir, err)\n    }\n}","typeGuard":"func isWellFormedOrg(o *genesisconfig.Organization) bool {\n    return o != nil && o.Name != \"\" && o.ID != \"\" && o.MSPDir != \"\"\n}","tryCatchPattern":"_, err := encoder.NewConsortiumGroup(consortiumConf)\nif err != nil {\n    if strings.Contains(err.Error(), \"failed to create consortium org\") {\n        // iterate orgs, validate MSP definitions\n    }\n    return err\n}","preventionTips":["Validate every org's MSPDir exists and contains cert files before encoding.","Use YAML anchors consistently so consortium orgs match declared Organizations.","Run configtxgen validation early in deployment scripts."],"tags":["hyperledger-fabric","configtx","consortium","msp"],"backgroundTag":"invalid-channel-config","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}