{"record":{"id":"e7ac5f71b6cc66d1","repo":"hashicorp/nomad","slug":"server-at-address-s-failed-ping-v","errorCode":null,"errorMessage":"Server at address %s failed ping: %v","messagePattern":"Server at address (.+?) failed ping: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/client.go","lineNumber":1313,"sourceCode":"\tendpoints := make([]*servers.Server, 0, len(in))\n\twg.Add(len(in))\n\n\tfor _, s := range in {\n\t\tgo func(srv string) {\n\t\t\tdefer wg.Done()\n\t\t\taddr, err := resolveServer(srv)\n\t\t\tif err != nil {\n\t\t\t\tmu.Lock()\n\t\t\t\tc.logger.Debug(\"ignoring server due to resolution error\", \"error\", err, \"server\", srv)\n\t\t\t\tmerr.Errors = append(merr.Errors, err)\n\t\t\t\tmu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Try to ping to check if it is a real server\n\t\t\tif err := c.Ping(addr); err != nil {\n\t\t\t\tmu.Lock()\n\t\t\t\tmerr.Errors = append(merr.Errors, fmt.Errorf(\"Server at address %s failed ping: %v\", addr, err))\n\t\t\t\tmu.Unlock()\n\n\t\t\t\t// If we are forcing the setting of the servers, inject it to\n\t\t\t\t// the serverlist even if we can't ping immediately.\n\t\t\t\tif !force {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmu.Lock()\n\t\t\tendpoints = append(endpoints, &servers.Server{Addr: addr})\n\t\t\tmu.Unlock()\n\t\t}(s)\n\t}\n\n\twg.Wait()\n\n\t// Only return errors if no servers are valid","sourceCodeStart":1295,"sourceCodeEnd":1331,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/client.go#L1295-L1331","documentation":"While refreshing its server list, the client pings each candidate server address to verify it is a real, reachable server. If c.Ping(addr) fails for a candidate, the address is recorded as a multi-error entry with this message. Depending on the force flag, the candidate may be discarded or still injected.","triggerScenarios":"Client heartbeat/server-list update loop: c.Ping(addr) returns an error (connection refused, timeout, TLS mismatch) for a server address in the returned server list.","commonSituations":"Server down or restarted, firewall/security group blocking the RPC port (4647), stale DNS entries pointing at decommissioned servers, network partition, or clients and servers with mismatched TLS/CA configuration.","solutions":["Check the wrapped %v ping error to distinguish connection-refused/timeout from TLS errors and fix the underlying cause.","Verify the Nomad servers' RPC port (default 4647) is reachable from the client: nc -zv <server> 4647.","Confirm DNS/addresses in the servers list resolve to live Nomad server nodes; remove stale entries.","If TLS is enabled, ensure the client's CA cert and server certs are valid and match on both sides."],"exampleFix":"// before (client.hcl with unreachable server)\nclient { servers = [\"10.0.0.5:4647\"] }  // server decommissioned\n// after\nclient { servers = [\"10.0.0.10:4647\", \"10.0.0.11:4647\"] }  # live servers\n# plus: open firewall\n# sudo ufw allow 4647/tcp","handlingStrategy":"retry","validationCode":"for _, addr := range servers {\n    conn, err := net.DialTimeout(\"tcp\", addr, 2*time.Second)\n    if err != nil {\n        log.Printf(\"server %s unreachable before join: %v\", addr, err)\n    } else {\n        conn.Close()\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := client.Ping(addr); err != nil {\n    merr.Errors = append(merr.Errors, err)\n    // retry with backoff, then try next server in the list\n    if !retryable(err) { return merr }\n    time.Sleep(backoff)\n    continue\n}","preventionTips":["Configure multiple servers in the client's servers list for redundancy","Open RPC port 4647 in firewalls/security groups between clients and servers","Keep server DNS records current; remove decommissioned server addresses","Keep TLS CA/cert configuration consistent across the cluster","Monitor server health so dead servers are replaced before clients notice"],"tags":["network","ping","rpc","server-discovery"],"backgroundTag":"ping-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"}