{"record":{"id":"ab35e9b20a49cf12","repo":"hyperledger/fabric","slug":"failed-parsing-orderer-endpoint-s","errorCode":null,"errorMessage":"failed parsing orderer endpoint %s","messagePattern":"failed parsing orderer endpoint (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"discovery/support/config/support.go","lineNumber":188,"sourceCode":"\t\t\t\treturn nil, errors.Wrap(err, \"failed unmarshalling orderer addresses\")\n\t\t\t}\n\t\t\t// Override the mapping because this orderer org config contains org-specific endpoints.\n\t\t\tres[fabricConfig.Name] = ordererEndpoints.Addresses\n\t\t}\n\t}\n\n\treturn res, nil\n}\n\nfunc globalEndpoints(endpointsByMSPID map[string][]string, ordererAddresses []string) (map[string]*discovery.Endpoints, error) {\n\tres := make(map[string]*discovery.Endpoints)\n\n\tfor mspID := range endpointsByMSPID {\n\t\tres[mspID] = &discovery.Endpoints{}\n\t\tfor _, endpoint := range ordererAddresses {\n\t\t\thost, portStr, err := net.SplitHostPort(endpoint)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Errorf(\"failed parsing orderer endpoint %s\", endpoint)\n\t\t\t}\n\t\t\tport, err := strconv.ParseInt(portStr, 10, 32)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Errorf(\"%s is not a valid port number\", portStr)\n\t\t\t}\n\t\t\tres[mspID].Endpoint = append(res[mspID].Endpoint, &discovery.Endpoint{\n\t\t\t\tHost: host,\n\t\t\t\tPort: uint32(port),\n\t\t\t})\n\t\t}\n\t}\n\treturn res, nil\n}\n\nfunc appendMSPConfigs(ordererGrp, appGrp map[string]*common.ConfigGroup, output map[string]*msp.FabricMSPConfig) error {\n\tfor _, group := range []map[string]*common.ConfigGroup{ordererGrp, appGrp} {\n\t\tfor _, grp := range group {\n\t\t\tmspConfig := &msp.MSPConfig{}","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/discovery/support/config/support.go#L170-L206","documentation":"This error means an entry in the global orderer address list could not be split into host and port with net.SplitHostPort, so the discovery service cannot build discovery.Endpoint entries. Because per-org endpoints are absent, globalEndpoints falls back to the channel-level orderer addresses (orderer.group values / general orderer addresses), and any malformed address aborts the whole computation. The message includes the offending endpoint string.","triggerScenarios":"globalEndpoints (called by computeOrdererEndpoints when no per-org endpoints exist) iterates ordererAddresses; net.SplitHostPort returns an error for addresses missing a port ('orderer.example.com'), using brackets incorrectly, containing spaces, or otherwise not host:port.","commonSituations":"Orderer.General.ListenAddress or channel config OrdererAddresses values set without :port; migration from older Fabric configs where addresses were host-only; configtx.yaml typos; environment variable substitution dropping the port.","solutions":["Correct the orderer address in channel config / configtx.yaml to include an explicit port, e.g. orderer.example.com:7050.","Regenerate and update the channel config with configtxgen/configtxlator after fixing the addresses.","Validate each address with net.SplitHostPort locally before submitting config updates.","Check for whitespace or bad IPv6 bracket formatting in OrdererAddresses values."],"exampleFix":"// before (configtx.yaml / channel config)\nOrdererAddresses:\n  - orderer.example.com\n// after\nOrdererAddresses:\n  - orderer.example.com:7050","handlingStrategy":"validation","validationCode":"func validateOrdererAddresses(addrs []string) error {\n    for _, a := range addrs {\n        if _, _, err := net.SplitHostPort(a); err != nil {\n            return fmt.Errorf(\"orderer address %q must be host:port\", a)\n        }\n    }\n    return nil\n}\n// call before invoking discovery / before config update:\n// err := validateOrdererAddresses(globalOrdererAddresses)","typeGuard":"func isHostPort(s string) bool {\n    host, port, err := net.SplitHostPort(s)\n    if err != nil || host == \"\" || port == \"\" {\n        return false\n    }\n    n, err := strconv.Atoi(port)\n    return err == nil && n > 0 && n < 65536\n}","tryCatchPattern":"eps, err := support.OrdererEndpoints()\nif err != nil {\n    if strings.Contains(err.Error(), \"failed parsing orderer endpoint\") {\n        // fall back to known-good statically configured orderer list\n    }\n    return err\n}","preventionTips":["Always specify orderer addresses as host:port in configtx.yaml OrdererAddresses and General.ListenAddress.","Run a config lint (net.SplitHostPort over all addresses) before channel creation/update.","Watch for migrations from older Fabric configs that used host-only addresses.","Trim whitespace and verify IPv6 bracket syntax when generating addresses from templates."],"tags":["network","hyperledger-fabric","config","endpoints"],"backgroundTag":"invalid-host-port","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"}