{"record":{"id":"8d85d36f281438cd","repo":"hashicorp/nomad","slug":"job-not-found-8d85d3","errorCode":null,"errorMessage":"job not found","messagePattern":"job not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/periodic_endpoint.go","lineNumber":70,"sourceCode":"\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 := p.srv.fsm.State().Snapshot()\n\tif err != nil {\n\t\treturn err\n\t}\n\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 force launch non-periodic job\")\n\t}\n\n\t// Force run the job.\n\teval, err := p.srv.periodicDispatcher.ForceEval(args.RequestNamespace(), job.ID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"force launch for job %q failed: %v\", job.ID, err)\n\t}\n\n\treply.EvalID = eval.ID\n\treply.EvalCreateIndex = eval.CreateIndex\n\treply.Index = eval.CreateIndex\n\treturn nil\n}\n","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/periodic_endpoint.go#L52-L88","documentation":"Periodic.Force looked up the job by ID in the requested namespace and found nothing; the job does not exist (wrong ID, wrong namespace, or not registered).","triggerScenarios":"Calling Force (RPC) with a JobID/namespace that doesn't match any registered job — deleted job, typo, or wrong namespace (RequestNamespace).","commonSituations":"Job purged between listing and force; default-namespace vs custom-namespace confusion; stale job ID in CI config; region mismatch querying a different cluster.","solutions":["Verify the job ID with `nomad job status`","Confirm you are targeting the correct namespace and region","Register the job before force-running it"],"exampleFix":"// before\n_, _, err := client.Jobs().PeriodicForce(\"my-job\", nil) // may not exist\n// after\njob, _, err := client.Jobs().Info(\"my-job\", nil)\nif err != nil || job == nil { return fmt.Errorf(\"job %q not found in namespace\", \"my-job\") }\n_, _, err = client.Jobs().PeriodicForce(\"my-job\", nil)","handlingStrategy":"validation","validationCode":"// Go: verify job existence and namespace first\njob, _, err := client.Jobs().Info(jobID, &api.QueryOptions{Namespace: ns})\nif err != nil || job == nil {\n    return fmt.Errorf(\"job %q not found in namespace %q\", jobID, ns)\n}","typeGuard":null,"tryCatchPattern":"// Go\nif _, err := client.Jobs().PeriodicForce(jobID, qo); err != nil {\n    if strings.Contains(err.Error(), \"job not found\") {\n        return fmt.Errorf(\"check job ID and namespace: %s/%s\", ns, jobID)\n    }\n    return err\n}","preventionTips":["Resolve job IDs from the jobs list API instead of config literals","Always specify the namespace explicitly","Re-check job existence after deletion workflows"],"tags":["nomad","not-found","namespace","rpc"],"backgroundTag":"entity-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"}