hashicorp/nomad · error

missing node ID for setting scheduling eligibility

Error message

missing node ID for setting scheduling eligibility

What it means

Guard in Node.UpdateEligibility: the scheduling-eligibility update request has an empty NodeID, so there is no node whose eligibility can be toggled.

Solutions

  1. Include the node ID in the eligibility request
  2. Use nomad node eligibility which supplies it
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

Thrown at nomad/node_endpoint.go:1044

	if done, err := n.srv.forward("Node.UpdateEligibility", args, args, reply); done {
		return err
	}
	n.srv.MeasureRPCRate("node", structs.RateMetricWrite, args)
	if authErr != nil {
		return structs.ErrPermissionDenied
	}
	defer metrics.MeasureSince([]string{"nomad", "client", "update_eligibility"}, time.Now())

	// Check node write permissions
	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)

View on GitHub (pinned to 482b49bf1a)