{"record":{"id":"75664beb2726f0d9","repo":"hashicorp/nomad","slug":"no-servers","errorCode":null,"errorMessage":"no servers","messagePattern":"no servers","errorType":"exception","errorClass":"noServersErr","httpStatus":null,"severity":"warning","filePath":"client/client.go","lineNumber":352,"sourceCode":"\t// users is a pool of dynamic workload users\n\tusers dynamic.Pool\n\n\t// identity is the node identity token that has been generated and signed by\n\t// the servers. This is used to authenticate the client to the servers when\n\t// performing RPC calls.\n\tidentity atomic.Value\n\n\t// identityForceRenewal is used to force the client to renew its identity\n\t// at the next heartbeat. It is set by an operator calling the node identity\n\t// renew RPC method.\n\tidentityForceRenewal atomic.Bool\n}\n\nvar (\n\t// noServersErr is returned by the RPC method when the client has no\n\t// configured servers. This is used to trigger Consul discovery if\n\t// enabled.\n\tnoServersErr = errors.New(\"no servers\")\n)\n\n// NewClient is used to create a new client from the given configuration.\n// `rpcs` is a map of RPC names to RPC structs that, if non-nil, will be\n// registered via https://golang.org/pkg/net/rpc/#Server.RegisterName in place\n// of the client's normal RPC handlers. This allows server tests to override\n// the behavior of the client.\nfunc NewClient(cfg *config.Config, consulCatalog consul.CatalogAPI, consulProxiesFunc consulApiShim.SupportedProxiesAPIFunc, consulServices serviceregistration.Handler, rpcs map[string]any) (*Client, error) {\n\t// Create the tls wrapper\n\tvar tlsWrap tlsutil.RegionWrapper\n\tif cfg.TLSConfig.EnableRPC {\n\t\ttw, err := tlsutil.NewTLSConfiguration(cfg.TLSConfig, true, true)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttlsWrap, err = tw.OutgoingTLSWrapper()\n\t\tif err != nil {\n\t\t\treturn nil, err","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/client.go#L334-L370","documentation":"noServersErr is a sentinel error returned by the Nomad client's RPC method when the client has no servers configured or discovered to talk to. It is not a hard failure: the client uses it as an internal signal to trigger Consul-based server discovery. Callers are expected to check for it with errors.Is and retry once servers become available.","triggerScenarios":"Client.RPC() returns it when c.servers is empty (no server list from config, no Consul discovery results yet, or servers previously failed health checks and were removed). Also surfaces in registration flows where the client cannot find any region servers to register with.","commonSituations":"Nomad agent started in client mode with server list omitted and Consul auto-discovery disabled or Consul unreachable; all configured servers are down or unreachable; retry_join still resolving; clients started before servers come up in rolling deployments.","solutions":["Configure servers explicitly via servers block or server_join.retry_join in the client config","Verify Consul is reachable and nomad services are registered if auto-discovery is used","Check network/firewall connectivity to servers on the RPC port (4647)","Wait/retry: the client automatically retries registration and triggers discovery when it sees this error"],"exampleFix":"// before\nservers = []\n// after (HCL client config)\nserver_join {\n  retry_join = [\"10.0.0.10\", \"10.0.0.11\"]\n  retry_max = 0\n}","handlingStrategy":"retry","validationCode":"// before issuing RPCs, check the client has servers\nif len(client.GetServers()) == 0 {\n    // wait or trigger discovery; skip RPC call\n    return fmt.Errorf(\"client has no servers yet\")\n}","typeGuard":null,"tryCatchPattern":"res, err := client.RPC(method, args, reply)\nif errors.Is(err, noServersErr) {\n    client.TriggerDiscovery()\n    // retry with backoff until servers are found\n    time.Sleep(registerRetryIntv)\n    return retryRPC(...)\n}\nif err != nil {\n    return err\n}","preventionTips":["Always configure server_join.retry_join or an explicit servers list for clients","Ensure Consul is reachable when auto-discovery is enabled","Monitor client logs for 'registration waiting on servers' at startup","Verify network reachability to port 4647 on servers before workloads start"],"tags":["nomad","rpc","discovery","client"],"backgroundTag":"no-servers-available","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"}