{"record":{"id":"c8297d685a0bae7a","repo":"hashicorp/nomad","slug":"failed-to-lookup-state-snapshot-v","errorCode":null,"errorMessage":"failed to lookup state snapshot: %v","messagePattern":"failed to lookup state snapshot: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"nomad/eval_endpoint.go","lineNumber":502,"sourceCode":"\t\treturn errors.New(\"eval broker is enabled; eval broker must be paused to delete evals\")\n\t}\n\n\tif args.Filter != \"\" {\n\t\tcount, index, err := e.deleteEvalsByFilter(args)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Update the index and return.\n\t\treply.Index = index\n\t\treply.Count = count\n\t\treturn nil\n\t}\n\n\t// Grab the state snapshot, so we can look up relevant eval information.\n\tserverStateSnapshot, err := e.srv.State().Snapshot()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to lookup state snapshot: %v\", err)\n\t}\n\tws := memdb.NewWatchSet()\n\n\tcount := 0\n\n\t// Iterate the evaluations and ensure they are safe to delete. It is\n\t// possible passed evals are not safe to delete and would make Nomads state\n\t// a little wonky. The nature of the RPC return error, means a single\n\t// unsafe eval ID fails the whole call.\n\tfor _, evalID := range args.EvalIDs {\n\n\t\tevalInfo, err := serverStateSnapshot.EvalByID(ws, evalID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to lookup eval: %v\", err)\n\t\t}\n\t\tif evalInfo == nil {\n\t\t\treturn errors.New(\"eval not found\")\n\t\t}","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/eval_endpoint.go#L484-L520","documentation":"Returned by Evaluations.Delete when the server cannot obtain a consistent state-store snapshot needed to verify the evals are safe to delete. The underlying state store error is embedded in the message.","triggerScenarios":"e.srv.State().Snapshot() fails during the Delete RPC, typically because the underlying BoltDB/raft state store is unavailable, corrupt, or the server is shutting down.","commonSituations":"Disk I/O errors or full disk on the server; state store closed during server shutdown/graceful leave; corruption after a crash.","solutions":["Check the embedded cause in the error message and fix the underlying state store issue (disk space, permissions, corruption)","Retry the request against a healthy server/leader","Restore the server from backup or rejoin it to the cluster if the state store is corrupt"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check server health first\n_, _, err := client.Agent().Health()\nif err != nil { return fmt.Errorf(\"server unhealthy: %w\", err) }","typeGuard":null,"tryCatchPattern":"err := deleteEvals(...)\nif err != nil && strings.Contains(err.Error(), \"failed to lookup state snapshot\") {\n    // retry later or target another server\n    return retryWithBackoff(err)\n}","preventionTips":["Monitor server disk space and BoltDB health","Avoid eval deletes during server shutdowns/rolling restarts","Route state-heavy RPCs to healthy servers only"],"tags":["nomad","state-store","snapshot","storage"],"backgroundTag":"state-store-unavailable","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"}