{"record":{"id":"d1f9ac3b94cb299b","repo":"hashicorp/nomad","slug":"missing-node-id-for-drain-update","errorCode":null,"errorMessage":"missing node ID for drain update","messagePattern":"missing node ID for drain update","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/node_endpoint.go","lineNumber":926,"sourceCode":"\tif done, err := n.srv.forward(\"Node.UpdateDrain\", 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_drain\"}, 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 err := n.checkNodeDrainAuth(aclObj, args); err != nil {\n\t\treturn err\n\t}\n\n\t// Verify the arguments\n\tif args.NodeID == \"\" {\n\t\treturn fmt.Errorf(\"missing node ID for drain update\")\n\t}\n\tif args.NodeEvent != nil {\n\t\treturn fmt.Errorf(\"node event must not be set\")\n\t}\n\n\t// The AuthenticatedIdentity is unexported so won't be written via\n\t// Raft. Record the identity string so it can be written to LastDrain\n\targs.UpdatedBy = args.GetIdentity().String()\n\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 {","sourceCodeStart":908,"sourceCodeEnd":944,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/node_endpoint.go#L908-L944","documentation":"Guard in Node.UpdateDrain: the drain update request carries an empty NodeID, so the drain strategy cannot be applied to any node.","triggerScenarios":"Thrown at nomad/node_endpoint.go:926 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply the target node's ID in the drain request","Use nomad node drain which fills in the ID"],"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"}