{"record":{"id":"1a8aef5a1f75f7a9","repo":"hashicorp/nomad","slug":"failed-to-parse-cron-expression-v","errorCode":null,"errorMessage":"Failed to parse cron expression: %v","messagePattern":"Failed to parse cron expression: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint.go","lineNumber":1933,"sourceCode":"\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\n\treply.FailedTGAllocs = updatedEval.FailedTGAllocs\n\treply.JobModifyIndex = index\n\treply.Annotations = annotations\n\treply.CreatedEvals = planner.CreateEvals\n\treply.Index = index\n\treturn nil\n}\n\n// validateJobUpdate ensures updates to a job are valid.\nfunc validateJobUpdate(old, new *structs.Job) error {\n\t// Validate Dispatch not set on new Jobs\n\tif old == nil {\n\t\tif new.Dispatched {\n\t\t\treturn fmt.Errorf(\"job can't be submitted with 'Dispatched' set\")\n\t\t}","sourceCodeStart":1915,"sourceCodeEnd":1951,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint.go#L1915-L1951","documentation":"Fires in Job.Plan for an enabled periodic job: computing the next launch time failed because the job's cron expression (or timezone) could not be parsed by the periodic scheduler.","triggerScenarios":"Thrown at nomad/job_endpoint.go:1933 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate the cron spec in the job's periodic block (e.g. with nomad job validate)","Fix the cron_expression or time_zone field and resubmit"],"exampleFix":null,"handlingStrategy":"validation","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"}