hashicorp/nomad · error

Failed to parse HTTP advertise address (%v, %v, %v, %v): %v

Error message

Failed to parse HTTP advertise address (%v, %v, %v, %v): %v

What it means

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.

Source

Thrown at command/agent/config.go:2408

	addr, err = normalizeBind(c.Addresses.Serf, c.BindAddr)
	if err != nil {
		return fmt.Errorf("Failed to parse Serf address: %v", err)
	}
	c.Addresses.Serf = addr

	c.normalizedAddrs = &NormalizedAddrs{
		RPC:  normalizeAddrWithPort(c.Addresses.RPC, c.Ports.RPC),
		Serf: normalizeAddrWithPort(c.Addresses.Serf, c.Ports.Serf),
	}
	c.normalizedAddrs.HTTP = make([]string, len(httpAddrs))
	for i, addr := range httpAddrs {
		c.normalizedAddrs.HTTP[i] = normalizeAddrWithPort(addr, c.Ports.HTTP)
	}

	addr, err = normalizeAdvertise(c.AdvertiseAddrs.HTTP, httpAddrs[0], c.Ports.HTTP, c.DevMode)
	if err != nil {
		return 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)
	}
	c.AdvertiseAddrs.HTTP = addr

	addr, err = normalizeAdvertise(c.AdvertiseAddrs.RPC, c.Addresses.RPC, c.Ports.RPC, c.DevMode)
	if err != nil {
		return fmt.Errorf("Failed to parse RPC advertise address: %v", err)
	}
	c.AdvertiseAddrs.RPC = addr

	// Skip serf if server is disabled
	if c.Server != nil && c.Server.Enabled {
		addr, err = normalizeAdvertise(c.AdvertiseAddrs.Serf, c.Addresses.Serf, c.Ports.Serf, c.DevMode)
		if err != nil {
			return fmt.Errorf("Failed to parse Serf advertise address: %v", err)
		}
		c.AdvertiseAddrs.Serf = addr
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Set advertise_addrs.http to a routable host:port other nodes can reach
  2. Use an IP or a DNS name resolvable on the machine; remove http:// scheme
  3. Avoid loopback addresses unless running in -dev mode
  4. Use the four values printed in the error to see which input is wrong

Example fix

// before
advertise_addrs { http = "http://my-host:8500" } // scheme not accepted
// after
advertise_addrs { http = "my-host:8500" }
Defensive patterns

Strategy: validation

Validate before calling

func validAdvertise(hostPort string) error {
	host, port, err := net.SplitHostPort(hostPort)
	if err != nil { return err }
	if ip := net.ParseIP(host); ip == nil {
		if _, err := net.LookupHost(host); err != nil { return err }
	}
	if _, err := strconv.Atoi(port); err != nil { return err }
	return nil
}
// run against advertise_addrs.http before starting the agent

Prevention

When it happens

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

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

Understand the failure class

Related errors


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