hashicorp/nomad · critical

No addresses found, please configure one.

Error message

No addresses found, please configure one.

What it means

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.

Source

Thrown at command/agent/config.go:2480

	_, err = net.InterfaceByName(out)
	if err != nil {
		return "", fmt.Errorf("invalid interface name %q", out)
	}

	return out, nil
}

// parseMultipleIPTemplate is used as a helper function to parse out a multiple IP
// addresses from a config parameter.
func parseMultipleIPTemplate(ipTmpl string) ([]string, error) {
	out, err := template.Parse(ipTmpl)
	if err != nil {
		return []string{}, fmt.Errorf("Unable to parse address template %q: %v", ipTmpl, err)
	}

	ips := strings.Split(out, " ")
	if len(ips) == 0 {
		return []string{}, errors.New("No addresses found, please configure one.")
	}

	return deduplicateAddrs(ips), nil
}

// normalizeAddrWithPort assumes that addr does not contain a port,
// noramlizes it per ipv6 RFC-5942 §4, and appends ":{port}".
func normalizeAddrWithPort(addr string, port int) string {
	return ipaddr.NormalizeAddr(net.JoinHostPort(addr, strconv.Itoa(port)))
}

// normalizeBind returns a normalized bind address.
//
// If addr is set it is used, if not the default bind address is used.
func normalizeBind(addr, bind string) (string, error) {
	if addr == "" {
		return bind, nil
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Set an explicit address (e.g. `bind_addr = "0.0.0.0"` or a concrete IP) instead of relying on a discovery template.
  2. 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).
  3. Ensure the host actually has the expected interfaces/IPs (check `ip addr`) and networking is initialized before the agent starts.
  4. If the template is wrong, replace it with one matching an existing interface family (IPv4 vs IPv6).

Example fix

// before
bind_addr = "{{ GetPrivateInterfaces | exclude \"lo\" | attr \"address\" }}"

// after (host has no private interfaces; bind explicitly)
bind_addr = "0.0.0.0"
Defensive patterns

Strategy: fallback

Validate before calling

out, err := renderSockAddrTemplate(tmpl) // same template the agent uses
ips := strings.Fields(out)
if err != nil || len(ips) == 0 {
    return errors.New("address template resolves to no addresses; set an explicit bind_addr")
}

Try / catch

addrs, err := resolveAddrs(cfg.BindAddr)
if err != nil {
    log.Warn("address template failed, falling back to explicit bind_addr", "err", err)
    addrs = []string{"0.0.0.0"}
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/f43bdf3b91f4a9c6. Report an issue: GitHub.