{"record":{"id":"58d953ea506e496e","repo":"hashicorp/nomad","slug":"missing-node-id-for-setting-scheduling-eligibility","errorCode":null,"errorMessage":"missing node ID for setting scheduling eligibility","messagePattern":"missing node ID for setting scheduling eligibility","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/node_endpoint.go","lineNumber":1044,"sourceCode":"\tif done, err := n.srv.forward(\"Node.UpdateEligibility\", args, args, reply); done {\n\t\treturn err\n\t}\n\tn.srv.MeasureRPCRate(\"node\", structs.RateMetricWrite, args)\n\tif authErr != nil {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"client\", \"update_eligibility\"}, time.Now())\n\n\t// Check node write permissions\n\tif aclObj, err := n.srv.ResolveACL(args); err != nil {\n\t\treturn err\n\t} else if !aclObj.AllowNodeWrite() {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\t// Verify the arguments\n\tif args.NodeID == \"\" {\n\t\treturn fmt.Errorf(\"missing node ID for setting scheduling eligibility\")\n\t}\n\tif args.NodeEvent != nil {\n\t\treturn fmt.Errorf(\"node event must not be set\")\n\t}\n\n\t// Check that only allowed types are set\n\tswitch args.Eligibility {\n\tcase structs.NodeSchedulingEligible, structs.NodeSchedulingIneligible:\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid scheduling eligibility %q\", args.Eligibility)\n\t}\n\n\t// Look for the node\n\tsnap, err := n.srv.fsm.State().Snapshot()\n\tif err != nil {\n\t\treturn err\n\t}\n\tnode, err := snap.NodeByID(nil, args.NodeID)","sourceCodeStart":1026,"sourceCodeEnd":1062,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/node_endpoint.go#L1026-L1062","documentation":"Guard in Node.UpdateEligibility: the scheduling-eligibility update request has an empty NodeID, so there is no node whose eligibility can be toggled.","triggerScenarios":"Thrown at nomad/node_endpoint.go:1044 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include the node ID in the eligibility request","Use nomad node eligibility which supplies it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}