micro/go-micro · error · ErrNoneAvailable

none available

Error message

none available

What it means

selector.ErrNoneAvailable is returned by Select() when services with the name exist in the registry but none of their nodes are currently considered available (all filtered out, or the default strategy finds zero usable nodes).

Source

Thrown at selector/selector.go:42

	// Name of the selector
	String() string
}

// Next is a function that returns the next node
// based on the selector's strategy.
type Next func() (*registry.Node, error)

// Filter is used to filter a service during the selection process.
type Filter func([]*registry.Service) []*registry.Service

// Strategy is a selection strategy e.g random, round robin.
type Strategy func([]*registry.Service) Next

var (
	DefaultSelector = NewSelector()

	ErrNotFound      = errors.New("not found")
	ErrNoneAvailable = errors.New("none available")
)

View on GitHub (pinned to 24529f1404)

Solutions

  1. Check that at least one healthy instance of the service is running and registered
  2. Review selector options/filters for conditions that exclude all nodes
  3. Implement retry/fallback in the client to handle transient unavailability
  4. Inspect registry contents to confirm nodes have valid reachable addresses

Example fix

// before
next, err := selector.Select("greeter")
if err != nil { return err } // fails when zero nodes available
// after
next, err := selector.Select("greeter")
if err == selector.ErrNoneAvailable {
  return retryAfter(time.Second) // or fall back to another service
}
Defensive patterns

Strategy: fallback

Validate before calling

svcs, _ := reg.GetService("greeter")
alive := 0
for _, s := range svcs { alive += len(s.Nodes) }
if alive == 0 { // none available; skip call or alert }
;

Type guard

func isNoneAvailable(err error) bool {
  return errors.Is(err, selector.ErrNoneAvailable)
}

Try / catch

next, err := sel.Select("greeter")
if errors.Is(err, selector.ErrNoneAvailable) {
  return fallbackCall() // alternate route or degrade gracefully
}

Prevention

When it happens

Trigger: Service nodes exist but all fail node filters/health criteria in the Select options; all registered nodes' addresses are unreachable/filtered; a custom Strategy returns an empty Next set; registry contains the service with an empty Nodes slice.

Common situations: All instances crashed or were deregistered mid-flight leaving stale metadata; network policy blocking all node endpoints; custom filter logic too strict; load-balancing pool drained during rolling deploys.

Related errors


AI-assisted analysis of micro/go-micro@24529f1404 (2026-09-01). Data as JSON: /api/errors/fde747fa06aa3e22. Report an issue: GitHub.