{"record":{"id":"a03cb7a0792ceab4","repo":"hashicorp/nomad","slug":"invalid-scheduling-eligibility-q","errorCode":null,"errorMessage":"invalid scheduling eligibility %q","messagePattern":"invalid scheduling eligibility %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/node_endpoint.go","lineNumber":1054,"sourceCode":"\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)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif node == nil {\n\t\treturn fmt.Errorf(\"node not found\")\n\t}\n\n\tif node.DrainStrategy != nil && args.Eligibility == structs.NodeSchedulingEligible {\n\t\treturn fmt.Errorf(\"can not set node's scheduling eligibility to eligible while it is draining\")\n\t}","sourceCodeStart":1036,"sourceCodeEnd":1072,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/node_endpoint.go#L1036-L1072","documentation":"Fires in Node.UpdateEligibility when args.Eligibility is neither NodeSchedulingEligible nor NodeSchedulingIneligible — an invalid or empty eligibility value was sent.","triggerScenarios":"Thrown at nomad/node_endpoint.go:1054 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of: eligible, ineligible when calling the API","Let nomad node eligibility produce the correct value"],"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"}