{"record":{"id":"cc772bbac94b8d5b","repo":"hyperledger/fabric","slug":"refusing-to-generate-block-which-is-missing-ordere","errorCode":null,"errorMessage":"refusing to generate block which is missing orderer section","messagePattern":"refusing to generate block which is missing orderer section","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/configtxgen/main.go","lineNumber":38,"sourceCode":"\t\"github.com/hyperledger/fabric-lib-go/common/flogging\"\n\tcb \"github.com/hyperledger/fabric-protos-go-apiv2/common\"\n\t\"github.com/hyperledger/fabric/internal/configtxgen/encoder\"\n\t\"github.com/hyperledger/fabric/internal/configtxgen/genesisconfig\"\n\t\"github.com/hyperledger/fabric/internal/configtxgen/metadata\"\n\t\"github.com/hyperledger/fabric/protoutil\"\n\t\"github.com/pkg/errors\"\n)\n\nvar logger = flogging.MustGetLogger(\"common.tools.configtxgen\")\n\nfunc doOutputBlock(config *genesisconfig.Profile, channelID string, outputBlock string) error {\n\tpgen, err := encoder.NewBootstrapper(config)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"could not create bootstrapper\")\n\t}\n\tlogger.Info(\"Generating genesis block\")\n\tif config.Orderer == nil {\n\t\treturn errors.New(\"refusing to generate block which is missing orderer section\")\n\t}\n\tif config.Consortiums != nil {\n\t\tlogger.Error(\"Warning: 'Consortiums' should be nil since system channel is no longer supported in Fabric v3.x\")\n\t} else {\n\t\tif config.Application == nil {\n\t\t\treturn errors.New(\"refusing to generate application channel block which is missing application section\")\n\t\t}\n\t\tlogger.Info(\"Creating application channel genesis block\")\n\t}\n\tgenesisBlock := pgen.GenesisBlockForChannel(channelID)\n\tlogger.Info(\"Writing genesis block\")\n\terr = writeFile(outputBlock, protoutil.MarshalOrPanic(genesisBlock), 0o640)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error writing genesis block: %s\", err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/cmd/configtxgen/main.go#L20-L56","documentation":"doOutputBlock creates a bootstrapper from the profile config and refuses to generate a genesis block when config.Orderer is nil, since a channel genesis block cannot be encoded without an orderer system-chain group. Fabric v3.x removed system-channel support, so the orderer section must still be present and correctly defined in the configtx profile.","triggerScenarios":"Running `configtxgen -outputBlock` with a configtx.yaml profile lacking the Orderer section (or Orderer: nil when constructing config programmatically); profile typo so the selected profile has no orderer config.","commonSituations":"Creating an application channel profile without copying the Orderer section; hand-trimmed configtx.yaml after removing the system channel; referencing the wrong profile name; upgrading to Fabric v3.x and dropping orderer config from profiles.","solutions":["Add a complete Orderer section (OrdererType, Addresses, Organizations etc.) to the profile used with -profile","Verify the -profile flag names an existing profile that includes orderer config","Ensure the referenced organization exists under Organizations and is listed in Orderer.Organizations","Compare against the sample configtx.yaml from the Fabric version in use"],"exampleFix":"# before (configtx.yaml profile)\nTwoOrgsChannel:\n  Consortium: SampleConsortium\n  Application: ...\n# after\nTwoOrgsChannel:\n  Orderer:\n    OrdererType: etcdraft\n    Addresses: [orderer.example.com:7050]\n    Organizations: [OrdererOrg]\n  Consortium: SampleConsortium\n  Application: ...","handlingStrategy":"validation","validationCode":"cfg, err := configtxlan.Load(profilePath)\nif err != nil { return err }\np := cfg.Profiles[profileName]\nif p == nil || p.Orderer == nil {\n    return fmt.Errorf(\"profile %s missing Orderer section\", profileName)\n}","typeGuard":null,"tryCatchPattern":"if err := doOutputBlock(...); err != nil {\n    if strings.Contains(err.Error(), \"missing orderer section\") {\n        return fmt.Errorf(\"add Orderer section to profile %s in configtx.yaml\", profileName)\n    }\n    return err\n}","preventionTips":["Include an Orderer section in every profile used with -outputBlock","Lint configtx.yaml in CI (configtxgen with a dry profile check)","After Fabric v3 upgrade, keep orderer config per-profile; no system channel reliance","Double-check -profile names match the YAML keys exactly"],"tags":["configtxgen","genesis-block","fabric","config"],"backgroundTag":"missing-orderer-section","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"}