{"record":{"id":"e43b2eaa932036f6","repo":"hyperledger/fabric","slug":"must-set-some-ordereraddresses","errorCode":null,"errorMessage":"Must set some OrdererAddresses","messagePattern":"Must set some OrdererAddresses","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/channel.go","lineNumber":221,"sourceCode":"\tcase bccsp.SHA3_256:\n\t\tcc.hashingAlgorithm = util.ComputeSHA3256\n\tdefault:\n\t\treturn fmt.Errorf(\"Unknown hashing algorithm type: %s\", cc.protos.HashingAlgorithm.Name)\n\t}\n\n\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateBlockDataHashingStructure() error {\n\tif cc.protos.BlockDataHashingStructure.Width != math.MaxUint32 {\n\t\treturn fmt.Errorf(\"BlockDataHashStructure width only supported at MaxUint32 in this version\")\n\t}\n\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateOrdererAddresses() error {\n\tif len(cc.protos.OrdererAddresses.Addresses) == 0 {\n\t\treturn fmt.Errorf(\"Must set some OrdererAddresses\")\n\t}\n\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateNoOrdererAddresses() error {\n\tif len(cc.protos.OrdererAddresses.Addresses) > 0 {\n\t\treturn fmt.Errorf(\"global OrdererAddresses are not allowed with V3_0 capability, use org specific addresses only\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":203,"sourceCodeEnd":232,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/channel.go#L203-L232","documentation":"ChannelConfig requires at least one global orderer address in the OrdererAddresses config value; validateOrdererAddresses returns this error when the list is empty. Orderer addresses are how clients locate the ordering service for the channel, so an empty list makes the config unusable for submission/delivery.","triggerScenarios":"Validate (called from NewChannelConfig) runs validateOrdererAddresses and cc.protos.OrdererAddresses.Addresses has length 0 — the OrdererAddresses value is absent from the Channel group or was created with an empty Addresses slice. Tests hit it via TestOrdererAddresses.","commonSituations":"configtx.yaml missing Orderer.Addresses / Consenter mappings; stripping the value during configtxlator edits; building channel config in tests without setting OrdererAddresses.","solutions":["Add orderer host:port entries under Channel: OrdererAddresses (or via Orderer: Endpoints in newer configtx.yaml) and regenerate","In code/tests, populate &cb.OrdererAddresses{Addresses: []string{\"host:port\"}} in the channel group values","If decoding existing config, confirm the OrdererAddresses value exists and its Addresses list is non-empty"],"exampleFix":"# before\nChannel: {} # no OrdererAddresses -> error\n\n# after\nChannel:\n    OrdererAddresses:\n        - orderer.example.com:7050","handlingStrategy":"validation","validationCode":"if channelGroup.Values[\"OrdererAddresses\"] == nil {\n    return errors.New(\"channel config must include OrdererAddresses\")\n}\noa := &cb.OrdererAddresses{}\n_ = proto.Unmarshal(channelGroup.Values[\"OrdererAddresses\"].Value, oa)\nif len(oa.Addresses) == 0 {\n    return errors.New(\"OrdererAddresses list is empty\")\n}","typeGuard":null,"tryCatchPattern":"cc, err := channelconfig.NewChannelConfig(channelGroup, bccsp)\nif err != nil {\n    if strings.Contains(err.Error(), \"Must set some OrdererAddresses\") {\n        return fmt.Errorf(\"add at least one orderer endpoint to the config\")\n    }\n    return err\n}","preventionTips":["Always set Orderer: Endpoints / Channel OrdererAddresses in configtx.yaml","Re-check the value survives configtxlator round-trips","For V2.x-and-below channels, keep the global list non-empty"],"tags":["fabric","channelconfig","orderer","network-address"],"backgroundTag":"missing-required-config-field","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"}