{"record":{"id":"6072957a13a1f092","repo":"hashicorp/nomad","slug":"maximum-attempts-reached-d","errorCode":null,"errorMessage":"maximum attempts reached (%d)","messagePattern":"maximum attempts reached \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scheduler/util.go","lineNumber":86,"sourceCode":"\tattempts := 0\n\tfor attempts < max {\n\t\tdone, err := cb()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif done {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Check if we should reset the number attempts\n\t\tif reset != nil && reset() {\n\t\t\tattempts = 0\n\t\t} else {\n\t\t\tattempts++\n\t\t}\n\t}\n\treturn &SetStatusError{\n\t\tErr:        fmt.Errorf(\"maximum attempts reached (%d)\", max),\n\t\tEvalStatus: structs.EvalStatusFailed,\n\t}\n}\n\n// progressMade checks to see if the plan result made allocations or updates.\n// If the result is nil, false is returned.\nfunc progressMade(result *structs.PlanResult) bool {\n\treturn result != nil && (len(result.NodeUpdate) != 0 ||\n\t\tlen(result.NodeAllocation) != 0 || result.Deployment != nil ||\n\t\tlen(result.DeploymentUpdates) != 0)\n}\n\n// taintedNodes is used to scan the allocations and then check if the\n// underlying nodes are tainted, and should force a migration of the allocation,\n// or if the underlying nodes are disconnected, and should be used to calculate\n// the reconnect timeout of its allocations. All the nodes returned in the map are tainted.\nfunc taintedNodes(state sstructs.State, allocs []*structs.Allocation) (map[string]*structs.Node, error) {\n\tout := make(map[string]*structs.Node)","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/scheduler/util.go#L68-L104","documentation":"retryMax terminal error: the scheduler exhausted its maximum plan-application attempts without the callback reporting done and without a reset of the attempt counter (i.e. no forward progress across retries). The eval is marked failed via SetStatusError.","triggerScenarios":"Thrown at scheduler/util.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Look for persistent plan-commit conflicts or state store errors in server logs","Check for pathological job/node churn that prevents any plan from fully committing","Re-submit or re-evaluate the job after resolving the underlying conflict"],"exampleFix":null,"handlingStrategy":"retry","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"}