hashicorp/nomad · warning

No servers found

Error message

No servers found

What it means

minRaftProtocol computes the minimum Raft protocol version across all autopilot-tracked servers. It initializes minVersion to -1 and returns this error when the server set is empty, meaning it could not determine any protocol version. Callers use this to gate Raft-protocol-dependent features.

Source

Thrown at nomad/autopilot.go:187

func stringIDs(ids []raft.ServerID) []string {
	return helper.ConvertSlice(ids, func(id raft.ServerID) string { return string(id) })
}

func minRaftProtocol(members []*peers.Parts) (int, error) {
	minVersion := -1
	for _, m := range members {
		if m.Status != serf.StatusAlive {
			continue
		}

		if minVersion == -1 || m.RaftVersion < minVersion {
			minVersion = m.RaftVersion
		}
	}

	if minVersion == -1 {
		return minVersion, fmt.Errorf("No servers found")
	}

	return minVersion, nil
}

func (s *Server) autopilotServers() map[raft.ServerID]*autopilot.Server {

	// Get a list of the regional peers for our local region. We cannot use the
	// LocalPeers function, as we need peers in all states.
	localPeers := s.peersCache.RegionPeers(s.Region())

	servers := make(map[raft.ServerID]*autopilot.Server, len(localPeers))

	for _, srv := range localPeers {
		autopilotServer := s.autopilotServerFromMetadata(srv)
		servers[autopilotServer.ID] = autopilotServer
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Retry after the server has fully joined the LAN pool and autopilot has enumerated peers.
  2. Check server logs / `nomad server members` to confirm servers are actually members.
  3. In tests, bootstrap the raft/serf state before calling MinRaftProtocol.

Example fix

// before
min, err := srv.MinRaftProtocol(false) // may return "No servers found" at startup
// after
min, err := srv.MinRaftProtocol(false)
if err != nil && err.Error() == "No servers found" {
    time.Sleep(time.Second)
    min, err = srv.MinRaftProtocol(false)
}
Defensive patterns

Strategy: retry

Validate before calling

members, err := client.Agent().Members()
if err != nil || len(members.Members) == 0 {
    return fmt.Errorf("no server members yet; defer MinRaftProtocol call")
}

Try / catch

min, err := srv.MinRaftProtocol(false)
for err != nil && strings.Contains(err.Error(), "No servers found") {
    time.Sleep(500 * time.Millisecond)
    min, err = srv.MinRaftProtocol(false)
}

Prevention

When it happens

Trigger: Calling MinRaftProtocol (via minRaftProtocol) when autopilotServers() returns an empty map — e.g. no servers are registered with autopilot yet, or the local server has no peer information.

Common situations: Querying raft protocol requirements during server startup before the LAN Serf membership is populated; running against a single-node setup with autopilot state not yet initialized; tests without a bootstrapped peer set.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/215ebf192659f70a. Report an issue: GitHub.