{"record":{"id":"46843dbf6d49e6b5","repo":"hyperledger/fabric","slug":"failed-to-create-consortium-s","errorCode":null,"errorMessage":"failed to create consortium %s","messagePattern":"failed to create consortium (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/configtxgen/encoder/encoder.go","lineNumber":422,"sourceCode":"\t\taddValue(applicationOrgGroup, channelconfig.AnchorPeersValue(anchorProtos), channelconfig.AdminsPolicyKey)\n\t}\n\n\treturn applicationOrgGroup, nil\n}\n\n// NewConsortiumsGroup returns the consortiums component of the channel configuration.  This element is only defined for the ordering system channel.\n// It sets the mod_policy for all elements to \"/Channel/Orderer/Admins\".\nfunc NewConsortiumsGroup(conf map[string]*genesisconfig.Consortium) (*cb.ConfigGroup, error) {\n\tconsortiumsGroup := protoutil.NewConfigGroup()\n\t// This policy is not referenced anywhere, it is only used as part of the implicit meta policy rule at the channel level, so this setting\n\t// effectively degrades control of the ordering system channel to the ordering admins\n\taddPolicy(consortiumsGroup, policies.SignaturePolicy(channelconfig.AdminsPolicyKey, policydsl.AcceptAllPolicy), ordererAdminsPolicyName)\n\n\tfor consortiumName, consortium := range conf {\n\t\tvar err error\n\t\tconsortiumsGroup.Groups[consortiumName], err = NewConsortiumGroup(consortium)\n\t\tif err != nil {\n\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\")","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/configtxgen/encoder/encoder.go#L404-L440","documentation":"This error is wrapped by NewConsortiumsGroup when building the Consortiums group of a channel config: it calls NewConsortiumGroup for each consortium in the profile and one of them failed. The underlying cause (e.g. a bad org definition) is wrapped with the consortium's name so the failing consortium can be identified. It indicates a malformed Consortiums section in the configtx profile.","triggerScenarios":"Calling NewChannelGroup (directly or via MakeGenesisBlock/encoder functions) on a genesisconfig.Profile whose Consortiums map contains a consortium whose Organizations list fails NewConsortiumOrgGroup (e.g. an org with missing/invalid MSPDir or ID).","commonSituations":"configtx.yaml system channel profile with a Consortiums section referencing orgs whose Organization definitions are incomplete (missing MSPDir or Name/ID mismatch), typos in org names, or org entries that fail channelconfig validation.","solutions":["Look at the wrapped inner error to identify which consortium org failed and fix that org's definition (MSPDir, ID, Name).","Verify every org listed under Consortiums -> <name> -> Organizations exists in the profile's Organizations section and validates as an MSP.","Run configtxgen with the same profile to reproduce and inspect the full wrapped error chain."],"exampleFix":"// before (configtx.yaml)\nConsortiums:\n  SampleConsortium:\n    Organizations:\n      - *OrgMissingMSP\n// after\nConsortiums:\n  SampleConsortium:\n    Organizations:\n      - *Org1   # org with valid Name, ID, and MSPDir","handlingStrategy":"validation","validationCode":"for name, consortium := range profile.Consortiums {\n    if len(consortium.Organizations) == 0 {\n        return fmt.Errorf(\"consortium %s has no organizations\", name)\n    }\n    for _, org := range consortium.Organizations {\n        if org.MSPDir == \"\" || org.ID == \"\" {\n            return fmt.Errorf(\"consortium %s org %s missing MSPDir/ID\", name, org.Name)\n        }\n    }\n}","typeGuard":"func hasValidConsortiums(p *genesisconfig.Profile) bool {\n    return p != nil && len(p.Consortiums) > 0\n}","tryCatchPattern":"group, err := encoder.NewChannelGroup(profile)\nif err != nil {\n    if strings.Contains(err.Error(), \"failed to create consortium\") {\n        // log consortium name from wrapped message, fix org defs\n    }\n    return err\n}","preventionTips":["Define all orgs referenced by consortiums with valid MSPDir and ID before running configtxgen.","Keep consortium org lists synchronized with the profile's Organizations section.","Lint configtx.yaml profiles in CI before generating genesis blocks."],"tags":["hyperledger-fabric","configtx","consortium","genesis-block"],"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"}