{"record":{"id":"bf26d50172999e6c","repo":"hashicorp/nomad","slug":"server-rpc-advertise-address-is-not-advertisable","errorCode":null,"errorMessage":"Server RPC advertise address is not advertisable: %v","messagePattern":"Server RPC advertise address is not advertisable: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/server.go","lineNumber":1260,"sourceCode":"\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\n}\n\n// setupStreamingEndpoints is used to populate an RPC server with streaming\n// endpoints. This only gets called at server startup.\nfunc (s *Server) setupStreamingEndpoints(server *rpc.Server) {\n\t// The endpoints are client RPCs and don't include a connection\n\t// context. They also need to be registered as streaming endpoints in their\n\t// register() methods.\n\n\tclientAllocs := NewClientAllocationsEndpoint(s)\n\tclientAllocs.register()\n\n\tfsEndpoint := NewFileSystemEndpoint(s)","sourceCodeStart":1242,"sourceCodeEnd":1278,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/server.go#L1242-L1278","documentation":"The Server RPC advertise address resolved to a *net.TCPAddr but its IP is unspecified (0.0.0.0 or ::). Nomad cannot publish an any-address to other servers/clients, so setupRPC() closes the listener and aborts startup.","triggerScenarios":"setupRPC(): s.serverRpcAdvertise ends up with an unspecified IP — typically ServerRPCAdvertise configured as 0.0.0.0:<port>, or the Serf-derived address defaulting to 0.0.0.0 while ServerRPCAdvertise is unset and the fallback did not pick a concrete IP.","commonSituations":"advertise { rpc = \"0.0.0.0\" } in server.hcl; nodes with wildcard bind addresses and no explicit advertise; containerized deployments relying on defaults.","solutions":["Set advertise { rpc = \"<specific-routable-ip>\" } in the server config","Ensure bind_addr is a concrete IP or that Serf advertise resolves to one so the derived address is not wildcard","Verify with `nomad server members` / node startup logs after fixing"],"exampleFix":"// before (server.hcl)\nadvertise {\n  rpc = \"0.0.0.0:4647\"\n}\n// after\nadvertise {\n  rpc = \"10.0.2.15:4647\"\n}","handlingStrategy":"validation","validationCode":"srv, err := net.ResolveTCPAddr(\"tcp\", advertiseRPC)\nif err != nil || srv.IP.IsUnspecified() {\n    return fmt.Errorf(\"server rpc advertise must be a specific IP, got %q\", advertiseRPC)\n}","typeGuard":"func isAdvertisable(a net.Addr) bool {\n    ta, ok := a.(*net.TCPAddr)\n    return ok && ta != nil && !ta.IP.IsUnspecified()\n}","tryCatchPattern":"if err := server.SetupRPC(ln); err != nil {\n    if strings.Contains(err.Error(), \"not advertisable\") {\n        logger.Error(\"set a specific IP in advertise { rpc }\")\n    }\n    return err\n}","preventionTips":["Always specify advertise { rpc = \"<ip>\" } in server.hcl","Audit configs with grep for 0.0.0.0/:: in advertise blocks before deploy","In containers, derive the pod/instance IP at runtime instead of defaults"],"tags":["network","configuration","startup","nomad"],"backgroundTag":"unspecified-advertise-address","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"}