{"record":{"id":"f43bdf3b91f4a9c6","repo":"hashicorp/nomad","slug":"no-addresses-found-please-configure-one","errorCode":null,"errorMessage":"No addresses found, please configure one.","messagePattern":"No addresses found, please configure one\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"command/agent/config.go","lineNumber":2480,"sourceCode":"\t_, err = net.InterfaceByName(out)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid interface name %q\", out)\n\t}\n\n\treturn out, nil\n}\n\n// parseMultipleIPTemplate is used as a helper function to parse out a multiple IP\n// addresses from a config parameter.\nfunc parseMultipleIPTemplate(ipTmpl string) ([]string, error) {\n\tout, err := template.Parse(ipTmpl)\n\tif err != nil {\n\t\treturn []string{}, fmt.Errorf(\"Unable to parse address template %q: %v\", ipTmpl, err)\n\t}\n\n\tips := strings.Split(out, \" \")\n\tif len(ips) == 0 {\n\t\treturn []string{}, errors.New(\"No addresses found, please configure one.\")\n\t}\n\n\treturn deduplicateAddrs(ips), nil\n}\n\n// normalizeAddrWithPort assumes that addr does not contain a port,\n// noramlizes it per ipv6 RFC-5942 §4, and appends \":{port}\".\nfunc normalizeAddrWithPort(addr string, port int) string {\n\treturn ipaddr.NormalizeAddr(net.JoinHostPort(addr, strconv.Itoa(port)))\n}\n\n// normalizeBind returns a normalized bind address.\n//\n// If addr is set it is used, if not the default bind address is used.\nfunc normalizeBind(addr, bind string) (string, error) {\n\tif addr == \"\" {\n\t\treturn bind, nil\n\t}","sourceCodeStart":2462,"sourceCodeEnd":2498,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/config.go#L2462-L2498","documentation":"When resolving addresses from a template (e.g. go-sockaddr templates like `{{ GetPrivateInterfaces }}`), the helper splits the rendered output on spaces and expects at least one address. If the split yields zero entries, it returns this error because the agent cannot bind to anything. Note that an empty template output commonly results in a single empty string rather than zero elements, so this branch fires when the template genuinely produces no tokens.","triggerScenarios":"Calling the address-template resolution used by agent config (config.go:2480 area) with an ipTmpl whose go-sockaddr output contains no addresses — e.g. `bind_addr`/address template evaluates against a host with no matching private interfaces.","commonSituations":"Running the agent in a container or minimal VM with no interfaces matching the template filter (no private IPs); template filtering (RFC range, CIDR) excluding all interfaces; networking not yet up at start time.","solutions":["Set an explicit address (e.g. `bind_addr = \"0.0.0.0\"` or a concrete IP) instead of relying on a discovery template.","Inspect the template with the same sockaddr tooling/CLI to see what it resolves to on this host and adjust its filter (CIDR, RFC scope).","Ensure the host actually has the expected interfaces/IPs (check `ip addr`) and networking is initialized before the agent starts.","If the template is wrong, replace it with one matching an existing interface family (IPv4 vs IPv6)."],"exampleFix":"// before\nbind_addr = \"{{ GetPrivateInterfaces | exclude \\\"lo\\\" | attr \\\"address\\\" }}\"\n\n// after (host has no private interfaces; bind explicitly)\nbind_addr = \"0.0.0.0\"","handlingStrategy":"fallback","validationCode":"out, err := renderSockAddrTemplate(tmpl) // same template the agent uses\nips := strings.Fields(out)\nif err != nil || len(ips) == 0 {\n    return errors.New(\"address template resolves to no addresses; set an explicit bind_addr\")\n}","typeGuard":null,"tryCatchPattern":"addrs, err := resolveAddrs(cfg.BindAddr)\nif err != nil {\n    log.Warn(\"address template failed, falling back to explicit bind_addr\", \"err\", err)\n    addrs = []string{\"0.0.0.0\"}\n}","preventionTips":["Verify the sockaddr template resolves non-empty output on target hosts before rollout.","Avoid over-restrictive template filters (CIDR/RFC scope) that can exclude all interfaces.","Ensure network interfaces are up before the agent starts (container/VM init ordering).","Provide an explicit bind_addr fallback in your deployment tooling."],"tags":["network","address-resolution","config","startup"],"backgroundTag":"no-addresses-found","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}