hashicorp/nomad · error

invalid scheduling eligibility %q

Error message

invalid scheduling eligibility %q

What it means

Fires in Node.UpdateEligibility when args.Eligibility is neither NodeSchedulingEligible nor NodeSchedulingIneligible — an invalid or empty eligibility value was sent.

Source

Thrown at nomad/node_endpoint.go:1054

	if aclObj, err := n.srv.ResolveACL(args); err != nil {
		return err
	} else if !aclObj.AllowNodeWrite() {
		return structs.ErrPermissionDenied
	}

	// Verify the arguments
	if args.NodeID == "" {
		return fmt.Errorf("missing node ID for setting scheduling eligibility")
	}
	if args.NodeEvent != nil {
		return fmt.Errorf("node event must not be set")
	}

	// Check that only allowed types are set
	switch args.Eligibility {
	case structs.NodeSchedulingEligible, structs.NodeSchedulingIneligible:
	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")
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Use one of: eligible, ineligible when calling the API
  2. Let nomad node eligibility produce the correct value
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nomad/node_endpoint.go:1054 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/a03cb7a0792ceab4. Report an issue: GitHub.