hashicorp/nomad · error

normalizedAddrs is nil or empty

Error message

normalizedAddrs is nil or empty

What it means

In finalizeClientConfig, after checking AdvertiseAddrs, Nomad checks a.config.normalizedAddrs — the resolved/normalized address set produced while binding. If normalizedAddrs is nil or normalizedAddrs.RPC is empty, the client cannot join the co-located server, so this error is returned. It typically means address normalization (resolving bind addresses to concrete IPs) failed or never ran.

Source

Thrown at command/agent/agent.go:812

// finalizeClientConfig sets configuration fields on the client config that are
// not statically convertible and are from the agent.
func (a *Agent) finalizeClientConfig(c *clientconfig.Config) error {
	// Setup the logging
	c.Logger = a.logger

	// If we are running a server, append both its bind and advertise address so
	// we are able to at least talk to the local server even if that isn't
	// configured explicitly. This handles both running server and client on one
	// host and -dev mode.
	if a.server != nil {
		advertised := a.config.AdvertiseAddrs
		normalized := a.config.normalizedAddrs

		if advertised == nil || advertised.RPC == "" {
			return fmt.Errorf("AdvertiseAddrs is nil or empty")
		} else if normalized == nil || normalized.RPC == "" {
			return fmt.Errorf("normalizedAddrs is nil or empty")
		}

		if normalized.RPC == advertised.RPC {
			c.Servers = append(c.Servers, normalized.RPC)
		} else {
			c.Servers = append(c.Servers, normalized.RPC, advertised.RPC)
		}
	}

	// Setup the plugin loaders
	c.PluginLoader = a.pluginLoader
	c.PluginSingletonLoader = a.pluginSingletonLoader

	// Log deprecation messages about Consul related configuration in client
	// options
	var invalidConsulKeys []string
	for key := range c.Options {
		if strings.HasPrefix(key, "consul") {

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Ensure ports.rpc (default 4647) and addresses/bind_addr are set so normalization produces a valid RPC address.
  2. Verify bind_addr resolves to a concrete IP (avoid unresolvable hostnames).
  3. Inspect earlier startup logs for address-normalization errors that left normalizedAddrs incomplete.

Example fix

// before
client { enabled = true }
# ports block missing rpc
// after
bind_addr = "0.0.0.0"
ports { rpc = 4647 }
client { enabled = true }
Defensive patterns

Strategy: validation

Validate before calling

if cfg.NormalizedAddrs == nil || cfg.NormalizedAddrs.RPC == "" {
  return errors.New("RPC address did not normalize; check bind_addr/addresses/ports.rpc")
}

Prevention

When it happens

Trigger: Combined server+client agent where the config's normalized address set is missing an RPC entry — e.g. addresses { rpc } / ports { rpc } misconfigured so normalization yields an empty RPC address, during startup or reload.

Common situations: Misconfigured ports block omitting rpc; hostname-based bind_addr that failed DNS resolution during normalization; programmatically built Config structs missing normalizedAddrs.

Related errors


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