{"record":{"id":"c24e23b67747d536","repo":"hashicorp/nomad","slug":"must-update-at-least-one-allocation-c24e23","errorCode":null,"errorMessage":"must update at least one allocation","messagePattern":"must update at least one allocation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/node_endpoint.go","lineNumber":1526,"sourceCode":"//   - The node is not registered in the server yet. Clients must first call the\n//     Register method.\n//   - The node status is down or disconnected. Clients must call the\n//     UpdateStatus method to update its status in the server.\nfunc (n *Node) UpdateAlloc(args *structs.AllocUpdateRequest, reply *structs.GenericResponse) error {\n\taclObj, err := n.srv.AuthenticateClientOnly(n.ctx, args)\n\tif done, err := n.srv.forward(\"Node.UpdateAlloc\", args, args, reply); done {\n\t\treturn err\n\t}\n\tn.srv.MeasureRPCRate(\"node\", structs.RateMetricWrite, args)\n\tif err != nil {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"client\", \"update_alloc\"}, time.Now())\n\n\t// Ensure at least a single alloc\n\tif len(args.Alloc) == 0 {\n\t\treturn fmt.Errorf(\"must update at least one allocation\")\n\t}\n\n\t// Ensure the node is allowed to update allocs.\n\t// The node needs to successfully heartbeat before updating its allocs.\n\ttargetNodeID := args.Alloc[0].NodeID\n\tif targetNodeID == \"\" {\n\t\treturn fmt.Errorf(\"missing node ID\")\n\t}\n\n\tnode, err := n.srv.State().NodeByID(nil, targetNodeID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to retrieve node %s: %v\", targetNodeID, err)\n\t}\n\tif node == nil {\n\t\treturn fmt.Errorf(\"node %s not found\", targetNodeID)\n\t}\n\tif !aclObj.AllowClientOp(node.NodePool) {\n\t\treturn structs.ErrPermissionDenied","sourceCodeStart":1508,"sourceCodeEnd":1544,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/node_endpoint.go#L1508-L1544","documentation":"Node.UpdateAlloc rejected the request because the AllocUpdateRequest contained an empty allocation list; the endpoint requires at least one allocation update to apply.","triggerScenarios":"Thrown at nomad/node_endpoint.go:1526 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send at least one allocation in args.Alloc","Fix the client-side logic that produced an empty batch of alloc updates"],"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"}