rqlite/rqlite · error

ErrNoAvailableHost

ErrNoAvailableHost

Error message

no host available to perform the request

What it means

Sentinel error ErrNoAvailableHost returned by the CLI HTTP client after it exhausted all candidate hosts (including retries and leader redirects) without getting a responsive one. Means every known node was unreachable or repeatedly failed at the point of the request.

Source

Thrown at cmd/rqlite/http/client.go:15

package http

import (
	"fmt"
	"io"
	"log"
	"maps"
	"net/http"
	"net/url"
	"os"
	"strings"
)

// ErrNoAvailableHost indicates that the client could not find an available host to send the request to.
var ErrNoAvailableHost = fmt.Errorf("no host available to perform the request")

// ErrTooManyRedirects indicates that the client exceeded the maximum number of redirects
var ErrTooManyRedirects = fmt.Errorf("maximum leader redirect limit exceeded")

// HostChangedError indicates that the underlying request was executed on a different host
// different from the caller anticipated
type HostChangedError struct {
	NewHost string
}

func (he *HostChangedError) Error() string {
	return fmt.Sprintf("HostChangedErr: new host is '%s'", he.NewHost)
}

type ConfigFunc func(*Client)

// Client is a wrapper around stock `http.Client` that adds "retry on another host" behaviour
// based on the supplied configuration.

View on GitHub (pinned to 7586a4d1bd)

Solutions

  1. Check that the cluster nodes are running and the supplied host list/addresses are correct
  2. Verify network connectivity and firewall rules to node HTTP ports
  3. Inspect individual host errors in the client log to find the root failure
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at cmd/rqlite/http/client.go:15 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of rqlite/rqlite@7586a4d1bd (2026-09-03). Data as JSON: /api/errors/b28abc2b744403a4. Report an issue: GitHub.