hashicorp/nomad · error
can not set node's scheduling eligibility to eligible while
Error message
can not set node's scheduling eligibility to eligible while it is draining
What it means
UpdateEligibility rejected the request because the target node currently has a DrainStrategy set; Nomad forbids marking a draining node as scheduling-eligible, since eligibility would let the scheduler place new work on a node being evacuated.
Source
Thrown at nomad/node_endpoint.go:1071
default:
return fmt.Errorf("invalid scheduling eligibility %q", args.Eligibility)
}
// Look for the node
snap, err := n.srv.fsm.State().Snapshot()
if err != nil {
return err
}
node, err := snap.NodeByID(nil, args.NodeID)
if err != nil {
return err
}
if node == nil {
return fmt.Errorf("node not found")
}
if node.DrainStrategy != nil && args.Eligibility == structs.NodeSchedulingEligible {
return fmt.Errorf("can not set node's scheduling eligibility to eligible while it is draining")
}
switch args.Eligibility {
case structs.NodeSchedulingEligible, structs.NodeSchedulingIneligible:
default:
return fmt.Errorf("invalid scheduling eligibility %q", args.Eligibility)
}
// Update the timestamp of when the node status was updated
args.UpdatedAt = time.Now().Unix()
// Construct the node event
args.NodeEvent = structs.NewNodeEvent().SetSubsystem(structs.NodeEventSubsystemCluster)
if node.SchedulingEligibility == args.Eligibility {
return nil // Nothing to do
} else if args.Eligibility == structs.NodeSchedulingEligible {
n.logger.Info("node transitioning to eligible state", "node_id", node.ID)
args.NodeEvent.SetMessage(NodeEligibilityEventEligible)View on GitHub (pinned to 482b49bf1a)
Solutions
- Finish or cancel the drain (`nomad node drain -disable <node>`) and wait for the DrainStrategy to clear before setting eligibility to eligible
- Set eligibility to ineligible instead if the intent is to keep the node out of scheduling during drain
- Check `nomad node status <node>` to confirm drain state before retrying
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nomad/node_endpoint.go:1071 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/f51a8b371692ac9f.
Report an issue: GitHub.