{"record":{"id":"e15f5bf31f162da5","repo":"hashicorp/nomad","slug":"failed-to-parse-http-advertise-address-v-v-v","errorCode":null,"errorMessage":"Failed to parse HTTP advertise address (%v, %v, %v, %v): %v","messagePattern":"Failed to parse HTTP advertise address \\((.+?), (.+?), (.+?), (.+?)\\): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/config.go","lineNumber":2408,"sourceCode":"\n\taddr, err = normalizeBind(c.Addresses.Serf, c.BindAddr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to parse Serf address: %v\", err)\n\t}\n\tc.Addresses.Serf = addr\n\n\tc.normalizedAddrs = &NormalizedAddrs{\n\t\tRPC:  normalizeAddrWithPort(c.Addresses.RPC, c.Ports.RPC),\n\t\tSerf: normalizeAddrWithPort(c.Addresses.Serf, c.Ports.Serf),\n\t}\n\tc.normalizedAddrs.HTTP = make([]string, len(httpAddrs))\n\tfor i, addr := range httpAddrs {\n\t\tc.normalizedAddrs.HTTP[i] = normalizeAddrWithPort(addr, c.Ports.HTTP)\n\t}\n\n\taddr, err = normalizeAdvertise(c.AdvertiseAddrs.HTTP, httpAddrs[0], c.Ports.HTTP, c.DevMode)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to parse HTTP advertise address (%v, %v, %v, %v): %v\", c.AdvertiseAddrs.HTTP, c.Addresses.HTTP, c.Ports.HTTP, c.DevMode, err)\n\t}\n\tc.AdvertiseAddrs.HTTP = addr\n\n\taddr, err = normalizeAdvertise(c.AdvertiseAddrs.RPC, c.Addresses.RPC, c.Ports.RPC, c.DevMode)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to parse RPC advertise address: %v\", err)\n\t}\n\tc.AdvertiseAddrs.RPC = addr\n\n\t// Skip serf if server is disabled\n\tif c.Server != nil && c.Server.Enabled {\n\t\taddr, err = normalizeAdvertise(c.AdvertiseAddrs.Serf, c.Addresses.Serf, c.Ports.Serf, c.DevMode)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to parse Serf advertise address: %v\", err)\n\t\t}\n\t\tc.AdvertiseAddrs.Serf = addr\n\t}\n","sourceCodeStart":2390,"sourceCodeEnd":2426,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/config.go#L2390-L2426","documentation":"After bind addresses are normalized, the HTTP advertise address is computed via normalizeAdvertise(user-specified AdvertiseAddrs.HTTP, first HTTP bind addr, HTTP port, DevMode). If the user-provided advertise address or the fallback cannot be resolved/validated, startup fails with this error which includes all four inputs (advertise, bind, port, devmode) plus the underlying cause for debugging.","triggerScenarios":"advertise_addrs.http set to an unresolvable hostname, unreachable IP, invalid 'host:port' pair, or a private/loopback address while not in -dev mode; or normalizeAdvertise failing to combine the address with Ports.HTTP.","commonSituations":"Advertising a DNS name that does not resolve on the node; advertising 127.0.0.1 on a clustered server (rejected outside dev mode); specifying a full URL scheme (http://) instead of host:port.","solutions":["Set advertise_addrs.http to a routable host:port other nodes can reach","Use an IP or a DNS name resolvable on the machine; remove http:// scheme","Avoid loopback addresses unless running in -dev mode","Use the four values printed in the error to see which input is wrong"],"exampleFix":"// before\nadvertise_addrs { http = \"http://my-host:8500\" } // scheme not accepted\n// after\nadvertise_addrs { http = \"my-host:8500\" }","handlingStrategy":"validation","validationCode":"func validAdvertise(hostPort string) error {\n\thost, port, err := net.SplitHostPort(hostPort)\n\tif err != nil { return err }\n\tif ip := net.ParseIP(host); ip == nil {\n\t\tif _, err := net.LookupHost(host); err != nil { return err }\n\t}\n\tif _, err := strconv.Atoi(port); err != nil { return err }\n\treturn nil\n}\n// run against advertise_addrs.http before starting the agent","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Advertise routable non-loopback addresses unless in -dev","Drop http:// scheme from advertise values","Verify DNS names resolve on the node itself"],"tags":["config","network","advertise-address"],"backgroundTag":"invalid-advertise-address","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}