{"record":{"id":"93192668dffbaa3a","repo":"hashicorp/nomad","slug":"failed-to-annotate-job-diff-v","errorCode":null,"errorMessage":"failed to annotate job diff: %v","messagePattern":"failed to annotate job diff: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint.go","lineNumber":1918,"sourceCode":"\t}\n\n\tif err := sched.Process(eval); err != nil {\n\t\treturn err\n\t}\n\n\t// Annotate and store the diff\n\tif plans := len(planner.Plans); plans != 1 {\n\t\treturn fmt.Errorf(\"scheduler resulted in an unexpected number of plans: %v\", plans)\n\t}\n\tannotations := planner.Plans[0].Annotations\n\tif args.Diff {\n\t\tjobDiff, err := existingJob.Diff(args.Job, true)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create job diff: %v\", err)\n\t\t}\n\n\t\tif err := scheduler.Annotate(jobDiff, annotations); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to annotate job diff: %v\", err)\n\t\t}\n\t\treply.Diff = jobDiff\n\t}\n\n\t// Grab the failures\n\tif len(planner.Evals) != 1 {\n\t\treturn fmt.Errorf(\"scheduler resulted in an unexpected number of eval updates: %v\", planner.Evals)\n\t}\n\tupdatedEval := planner.Evals[0]\n\n\t// If it is a periodic job calculate the next launch\n\tif args.Job.IsPeriodic() && args.Job.Periodic.Enabled {\n\t\treply.NextPeriodicLaunch, err = args.Job.Periodic.Next(time.Now().In(args.Job.Periodic.GetLocation()))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to parse cron expression: %v\", err)\n\t\t}\n\t}\n","sourceCodeStart":1900,"sourceCodeEnd":1936,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint.go#L1900-L1936","documentation":"Fires in Job.Plan when scheduler.Annotate fails to attach scheduler annotations (in-place updates, destructive changes) to the computed job diff; the plan run itself succeeded but its human-readable diff could not be produced.","triggerScenarios":"Thrown at nomad/job_endpoint.go:1918 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the job plan request","Report persistent failures with the job spec, as annotation depends on diff shape"],"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"}