{"record":{"id":"c583e16b27249ae7","repo":"hyperledger/fabric","slug":"failed-unmarshalling-orderer-addresses","errorCode":null,"errorMessage":"failed unmarshalling orderer addresses","messagePattern":"failed unmarshalling orderer addresses","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"discovery/support/config/support.go","lineNumber":76,"sourceCode":"\t}\n\n\tif err := ValidateConfig(config); err != nil {\n\t\treturn nil, errors.WithMessage(err, \"config is invalid\")\n\t}\n\n\tres := &discovery.ConfigResult{\n\t\tMsps:     make(map[string]*msp.FabricMSPConfig),\n\t\tOrderers: make(map[string]*discovery.Endpoints),\n\t}\n\tordererGrp := config.ChannelGroup.Groups[channelconfig.OrdererGroupKey].Groups\n\tappGrp := config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups\n\n\tvar globalEndpoints []string\n\tglobalOrderers := config.ChannelGroup.Values[channelconfig.OrdererAddressesKey]\n\tif globalOrderers != nil {\n\t\tordererAddressesConfig := &common.OrdererAddresses{}\n\t\tif err := proto.Unmarshal(globalOrderers.Value, ordererAddressesConfig); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed unmarshalling orderer addresses\")\n\t\t}\n\t\tglobalEndpoints = ordererAddressesConfig.Addresses\n\t}\n\n\tordererEndpoints, err := computeOrdererEndpoints(ordererGrp, globalEndpoints)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed computing orderer addresses\")\n\t}\n\tres.Orderers = ordererEndpoints\n\n\tif err := appendMSPConfigs(ordererGrp, appGrp, res.Msps); err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\treturn res, nil\n}\n\nfunc computeOrdererEndpoints(ordererGrp map[string]*common.ConfigGroup, globalOrdererAddresses []string) (map[string]*discovery.Endpoints, error) {\n\tendpointsByMSPID, err := perOrgEndpointsByMSPID(ordererGrp)","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/discovery/support/config/support.go#L58-L94","documentation":"When assembling the config result, discovery reads the channel-level OrdererAddresses value from the config and unmarshals it as common.OrdererAddresses. If those raw bytes don't parse as that protobuf message, the config data itself is corrupt or of an unexpected type, and the query fails with this wrapped error.","triggerScenarios":"config.ChannelGroup.Values[channelconfig.OrdererAddressesKey] holds bytes that fail proto.Unmarshal into &common.OrdererAddresses{} — e.g. hand-edited or malformed channel configuration.","commonSituations":"Manually patched channel config blocks; config produced by non-standard tooling; corrupted ledger config data after a failed config update transaction.","solutions":["Inspect and repair the channel configuration so OrdererAddresses is a valid common.OrdererAddresses protobuf","Regenerate the channel config from configtx.yaml and apply a proper config update","Restore the peer's ledger/config from a good backup if the stored config is corrupted"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"oa := &common.OrdererAddresses{}\nif err := proto.Unmarshal(globalOrderersValue, oa); err != nil {\n    return fmt.Errorf(\"channel config orderer addresses corrupt: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"res, err := client.Send(ctx, req)\nif err != nil {\n    if strings.Contains(err.Error(), \"failed unmarshalling orderer addresses\") {\n        // channel config data corrupt — repair via config update\n    }\n    return err\n}","preventionTips":["Never hand-edit serialized channel config blocks","Apply config changes only through standard config update transactions","Validate generated config with configtxlator before committing"],"tags":["fabric","discovery","config","protobuf"],"backgroundTag":"protobuf-unmarshal-failed","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"}