{"record":{"id":"0233b4dc32b5ddd2","repo":"hashicorp/nomad","slug":"failed-to-resolve-server-rpc-advertise-address-v","errorCode":null,"errorMessage":"Failed to resolve Server RPC advertise address: %v","messagePattern":"Failed to resolve Server RPC advertise address: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/server.go","lineNumber":1247,"sourceCode":"\t}\n\tif clientAddr.IP.IsUnspecified() {\n\t\tlistener.Close()\n\t\treturn fmt.Errorf(\"Client RPC advertise address is not advertisable: %v\", clientAddr)\n\t}\n\n\tif s.config.ServerRPCAdvertise != nil {\n\t\ts.serverRpcAdvertise = s.config.ServerRPCAdvertise\n\t} else {\n\t\t// Default to the Serf Advertise + RPC Port\n\t\tserfIP := s.config.SerfConfig.MemberlistConfig.AdvertiseAddr\n\t\tif serfIP == \"\" {\n\t\t\tserfIP = s.config.SerfConfig.MemberlistConfig.BindAddr\n\t\t}\n\n\t\taddr := net.JoinHostPort(serfIP, fmt.Sprintf(\"%d\", clientAddr.Port))\n\t\tresolved, err := net.ResolveTCPAddr(\"tcp\", addr)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to resolve Server RPC advertise address: %v\", err)\n\t\t}\n\n\t\ts.serverRpcAdvertise = resolved\n\t}\n\n\t// Verify that we have a usable advertise address\n\tserverAddr, ok := s.serverRpcAdvertise.(*net.TCPAddr)\n\tif !ok {\n\t\treturn fmt.Errorf(\"Server RPC advertise address is not a TCP Address: %v\", serverAddr)\n\t}\n\tif serverAddr.IP.IsUnspecified() {\n\t\tlistener.Close()\n\t\treturn fmt.Errorf(\"Server RPC advertise address is not advertisable: %v\", serverAddr)\n\t}\n\n\twrapper := tlsutil.RegionSpecificWrapper(s.config.Region, tlsWrap)\n\ts.raftLayer = NewRaftLayer(s.serverRpcAdvertise, wrapper)\n\treturn nil","sourceCodeStart":1229,"sourceCodeEnd":1265,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/server.go#L1229-L1265","documentation":"When no explicit Server RPC advertise address is configured, Nomad derives one from the Serf advertise IP (falling back to the memberlist BindAddr) joined with the client RPC port. It then resolves that host:port with net.ResolveTCPAddr; any resolution failure is wrapped in this error.","triggerScenarios":"setupRPC(): serfIP falls back to s.config.SerfConfig.MemberlistConfig.BindAddr (e.g. a hostname or invalid string) and net.ResolveTCPAddr(\"tcp\", \"<serfIP>:<port>\") returns an error such as DNS lookup failure or malformed address.","commonSituations":"serf bind_addr set to a hostname that fails DNS resolution; bind addr containing an interface name or invalid value; IPv6 literal mishandled; resolv.conf broken so the hostname cannot resolve.","solutions":["Fix serf bind/advertise address in config to a valid IP or resolvable hostname","Set server_rpc advertise explicitly (advertise { rpc = \"<ip>\" }) so resolution of the Serf-derived address is bypassed","Verify DNS resolution on the host: `getent hosts <serfIP>` / check /etc/resolv.conf"],"exampleFix":"// before (server.hcl)\nbind_addr = \"my-host-internal\"\n// after\nbind_addr = \"0.0.0.0\"\nadvertise {\n  rpc = \"10.0.2.15\"\n}","handlingStrategy":"validation","validationCode":"if _, err := net.ResolveTCPAddr(\"tcp\", serfBindAddr+\":0\"); err != nil {\n    return fmt.Errorf(\"serf bind addr %q unresolvable: %w\", serfBindAddr, err)\n}","typeGuard":null,"tryCatchPattern":"if err := server.Setup(); err != nil {\n    if strings.Contains(err.Error(), \"Failed to resolve\") {\n        logger.Error(\"advertise address unresolvable; check DNS/bind_addr\", \"err\", err)\n    }\n    return err\n}","preventionTips":["Use IP literals or verified hostnames for bind_addr","Test DNS resolution on the host before deployment (getent hosts)","Set explicit advertise addresses to avoid Serf-derived resolution"],"tags":["network","dns","configuration","nomad"],"backgroundTag":"address-resolution-failed","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"}