{"record":{"id":"c7a6ed3cc61d1b26","repo":"hashicorp/nomad","slug":"failed-to-parse-http-address-v","errorCode":null,"errorMessage":"Failed to parse HTTP address: %v","messagePattern":"Failed to parse HTTP address: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/config.go","lineNumber":2381,"sourceCode":"\tnc.ExtraKeysHCL = slices.Clone(c.ExtraKeysHCL)\n\treturn &nc\n}\n\n// normalizeAddrs normalizes Addresses and AdvertiseAddrs to always be\n// initialized and have reasonable defaults.\nfunc (c *Config) normalizeAddrs() error {\n\tif c.BindAddr != \"\" {\n\t\tipStr, err := listenerutil.ParseSingleIPTemplate(c.BindAddr)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Bind address resolution failed: %v\", err)\n\t\t}\n\t\tc.BindAddr = ipStr\n\t}\n\tc.BindAddr = ipaddr.NormalizeAddr(c.BindAddr)\n\n\thttpAddrs, err := normalizeMultipleBind(c.Addresses.HTTP, c.BindAddr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to parse HTTP address: %v\", err)\n\t}\n\tc.Addresses.HTTP = strings.Join(httpAddrs, \" \")\n\n\taddr, err := normalizeBind(c.Addresses.RPC, c.BindAddr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to parse RPC address: %v\", err)\n\t}\n\tc.Addresses.RPC = addr\n\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),","sourceCodeStart":2363,"sourceCodeEnd":2399,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/config.go#L2363-L2399","documentation":"During agent config normalization, the HTTP bind address(es) (Addresses.HTTP, possibly a multi-IP template) are normalized against the default BindAddr via normalizeMultipleBind. If any address in the list fails to parse (invalid host, unparseable template result, bad IP), this error wraps and surfaces the underlying cause. It means the HTTP listener address could not be resolved to valid bind targets.","triggerScenarios":"Setting addresses.http in the agent config (or -http-addr style config) to a value that normalizeMultipleBind cannot parse: a template that fails to render, an invalid IP/host string, or an empty/whitespace entry; also when bind is unset and the derived default is invalid.","commonSituations":"Typos in addresses.http; consul-template syntax errors in an interface-template expression; multiple addresses separated incorrectly (not space-delimited after template expansion); DNS name that does not resolve in the environment.","solutions":["Check the addresses.http value in your config; fix the malformed address or template syntax","Test the template with 'consul template'-style rendering or run with -dev to isolate the value","Use a valid IP like 0.0.0.0 or 127.0.0.1 to confirm the rest of the config is fine","Consult the wrapped %v detail: it names the actual parse failure"],"exampleFix":"// before\naddresses { http = \"{{ GetInterfaceIP \\\"eth0\\\"  \" } // broken template\n// after\naddresses { http = \"{{ GetInterfaceIP \\\"eth0\\\" }}\" }","handlingStrategy":"validation","validationCode":"func validAddrList(v string) bool {\n\tif v == \"\" { return true }\n\tfor _, a := range strings.Fields(v) {\n\t\tif net.ParseIP(a) == nil { return false }\n\t}\n\treturn true\n}\n// call before writing config: if !validAddrList(cfg.Addresses.HTTP) { fix }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep addresses.http as a bare IP or well-tested template","Test templates in a staging agent before production","Never embed ports in address fields"],"tags":["config","network","bind-address"],"backgroundTag":"invalid-bind-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"}