{"record":{"id":"3da7b962ac23e3fa","repo":"hashicorp/nomad","slug":"normalizedaddrs-is-nil-or-empty","errorCode":null,"errorMessage":"normalizedAddrs is nil or empty","messagePattern":"normalizedAddrs is nil or empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/agent.go","lineNumber":812,"sourceCode":"\n// finalizeClientConfig sets configuration fields on the client config that are\n// not statically convertible and are from the agent.\nfunc (a *Agent) finalizeClientConfig(c *clientconfig.Config) error {\n\t// Setup the logging\n\tc.Logger = a.logger\n\n\t// If we are running a server, append both its bind and advertise address so\n\t// we are able to at least talk to the local server even if that isn't\n\t// configured explicitly. This handles both running server and client on one\n\t// host and -dev mode.\n\tif a.server != nil {\n\t\tadvertised := a.config.AdvertiseAddrs\n\t\tnormalized := a.config.normalizedAddrs\n\n\t\tif advertised == nil || advertised.RPC == \"\" {\n\t\t\treturn fmt.Errorf(\"AdvertiseAddrs is nil or empty\")\n\t\t} else if normalized == nil || normalized.RPC == \"\" {\n\t\t\treturn fmt.Errorf(\"normalizedAddrs is nil or empty\")\n\t\t}\n\n\t\tif normalized.RPC == advertised.RPC {\n\t\t\tc.Servers = append(c.Servers, normalized.RPC)\n\t\t} else {\n\t\t\tc.Servers = append(c.Servers, normalized.RPC, advertised.RPC)\n\t\t}\n\t}\n\n\t// Setup the plugin loaders\n\tc.PluginLoader = a.pluginLoader\n\tc.PluginSingletonLoader = a.pluginSingletonLoader\n\n\t// Log deprecation messages about Consul related configuration in client\n\t// options\n\tvar invalidConsulKeys []string\n\tfor key := range c.Options {\n\t\tif strings.HasPrefix(key, \"consul\") {","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/agent.go#L794-L830","documentation":"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.","triggerScenarios":"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.","commonSituations":"Misconfigured ports block omitting rpc; hostname-based bind_addr that failed DNS resolution during normalization; programmatically built Config structs missing normalizedAddrs.","solutions":["Ensure ports.rpc (default 4647) and addresses/bind_addr are set so normalization produces a valid RPC address.","Verify bind_addr resolves to a concrete IP (avoid unresolvable hostnames).","Inspect earlier startup logs for address-normalization errors that left normalizedAddrs incomplete."],"exampleFix":"// before\nclient { enabled = true }\n# ports block missing rpc\n// after\nbind_addr = \"0.0.0.0\"\nports { rpc = 4647 }\nclient { enabled = true }","handlingStrategy":"validation","validationCode":"if cfg.NormalizedAddrs == nil || cfg.NormalizedAddrs.RPC == \"\" {\n  return errors.New(\"RPC address did not normalize; check bind_addr/addresses/ports.rpc\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Explicitly set ports.rpc (4647) and a resolvable bind_addr.","Avoid hostnames that may fail DNS resolution at bind time.","Dry-run config changes before rollout."],"tags":["config","nomad","network","address-normalization"],"backgroundTag":"advertise-addr-missing","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"}