{"record":{"id":"909d0818e5af649b","repo":"hashicorp/nomad","slug":"failed-to-parse-serf-address-v","errorCode":null,"errorMessage":"Failed to parse Serf address: %v","messagePattern":"Failed to parse Serf address: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/config.go","lineNumber":2393,"sourceCode":"\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),\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","sourceCodeStart":2375,"sourceCodeEnd":2411,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/config.go#L2375-L2411","documentation":"Same normalization pass as RPC/HTTP: Addresses.Serf is validated with normalizeBind against BindAddr. A Serf bind address that cannot be parsed (invalid IP or failing template) stops agent startup with this error. The wrapped %v explains the concrete parse problem.","triggerScenarios":"addresses.serf set to a malformed IP, a template ({{ GetInterfaceIP ... }}) that fails or returns nothing parseable, or an address containing an illegal port/zone component.","commonSituations":"Typo in interface name inside the template (e.g. eth01); LAN interface absent at boot on VMs/containers so the template resolves empty; stray whitespace or quotes around the value in HCL/JSON.","solutions":["Correct addresses.serf to a valid IP or fix the template syntax","Confirm the interface name in the template exists on the host","Ensure the value is a bare address without scheme or port","Check the wrapped %v message for the underlying cause"],"exampleFix":"// before\naddresses { serf = \"{{ GetInterfaceIP \\\"en01\\\" }}\" } # interface typo\n// after\naddresses { serf = \"{{ GetInterfaceIP \\\"en0\\\" }}\" }","handlingStrategy":"validation","validationCode":"func validSerfAddr(v string) bool {\n\tif v == \"\" { return true }\n\treturn net.ParseIP(v) != nil || strings.HasPrefix(v, \"{{\")\n}\n// plus confirm any templated interface exists: iface, _ := net.InterfaceByName(name)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify interface names referenced by templates exist on the host","Use `consul validate` in CI for every config change","Avoid quotes/whitespace artifacts around the value"],"tags":["config","network","bind-address","serf"],"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"}