{"record":{"id":"06b38153308bedc5","repo":"hashicorp/nomad","slug":"job-not-found","errorCode":null,"errorMessage":"job not found","messagePattern":"job not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint.go","lineNumber":714,"sourceCode":"\t}\n\n\t// Validate the arguments\n\tif args.JobID == \"\" {\n\t\treturn fmt.Errorf(\"missing job ID for evaluation\")\n\t}\n\n\t// Lookup the job\n\tsnap, err := j.srv.fsm.State().Snapshot()\n\tif err != nil {\n\t\treturn err\n\t}\n\tws := memdb.NewWatchSet()\n\tjob, err := snap.JobByID(ws, args.RequestNamespace(), args.JobID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif job == nil {\n\t\treturn fmt.Errorf(\"job not found\")\n\t}\n\n\tif job.IsPeriodic() {\n\t\treturn fmt.Errorf(\"can't evaluate periodic job\")\n\t} else if job.IsParameterized() {\n\t\treturn fmt.Errorf(\"can't evaluate parameterized job\")\n\t}\n\n\tforceRescheduleAllocs := make(map[string]*structs.DesiredTransition)\n\n\tif args.EvalOptions.ForceReschedule {\n\t\t// Find any failed allocs that could be force rescheduled\n\t\tallocs, err := snap.AllocsByJob(ws, args.RequestNamespace(), args.JobID, false)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, alloc := range allocs {","sourceCodeStart":696,"sourceCodeEnd":732,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint.go#L696-L732","documentation":"The Job.Evaluate RPC looked up the job by ID and namespace in the state store and got nil — no such job exists. Nomad throws this plain 'job not found' because it cannot force an evaluation for a job that was never registered or has been deregistered.","triggerScenarios":"POST /v1/job/<id>/evaluate (or periodic force) where the job ID is misspelled, the job was deregistered, or the request namespace does not contain the job.","commonSituations":"CI pipelines evaluating a job after a failed deploy removed it; wrong namespace in token/policy resolution; idempotent scripts re-running after job cleanup; purge=true deregistration followed by a forced evaluation.","solutions":["Confirm the job exists: nomad job status <id> or GET /v1/job/<id>","Check the namespace (NOMAD_NAMESPACE or -namespace flag) matches where the job lives","Re-register the job first if it was deregistered, then evaluate","Correct the job ID in the calling script"],"exampleFix":"// before\nclient.Jobs().Evaluate(\"web-app\", nil)\n// after\nif _, _, err := client.Jobs().Info(\"web-app\", nil); err != nil {\n    return fmt.Errorf(\"job web-app not found: %w\", err)\n}\nclient.Jobs().Evaluate(\"web-app\", nil)","handlingStrategy":"validation","validationCode":"_, _, err := client.Jobs().Info(jobID, nil)\nif err != nil { return fmt.Errorf(\"job %q not found before evaluate: %w\", jobID, err) }","typeGuard":null,"tryCatchPattern":"_, _, err := client.Jobs().Evaluate(jobID, nil)\nif err != nil && strings.Contains(err.Error(), \"job not found\") {\n\treturn fmt.Errorf(\"job %s missing; re-register it first\", jobID)\n}","preventionTips":["Check job existence with Jobs().Info before evaluating","Confirm NOMAD_NAMESPACE matches where the job was registered","Treat deregister+evaluate flows as ordered, not parallel"],"tags":["nomad","not-found","job-lookup"],"backgroundTag":"resource-not-found","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"}