{"record":{"id":"81b52f08a69771cf","repo":"hashicorp/nomad","slug":"cron-end-must-not-contain-q","errorCode":null,"errorMessage":"cron.end must not contain %q","messagePattern":"cron\\.end must not contain %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/task_sched.go","lineNumber":86,"sourceCode":"\t}\n\n\tconst (\n\t\tstartFields     = 6\n\t\tendFields       = 2\n\t\trestrictedChars = \"/,\"\n\t)\n\n\tif strings.Count(t.Cron.Start, \" \") != (startFields - 1) {\n\t\treturn fmt.Errorf(\"cron.start must contain %d fields\", startFields)\n\t}\n\tif strings.Count(t.Cron.End, \" \") != (endFields - 1) {\n\t\treturn fmt.Errorf(\"cron.end must contain %d fields\", endFields)\n\t}\n\tif strings.ContainsAny(t.Cron.Start, restrictedChars) {\n\t\treturn fmt.Errorf(\"cron.start must not contain %q\", restrictedChars)\n\t}\n\tif strings.ContainsAny(t.Cron.End, restrictedChars) {\n\t\treturn fmt.Errorf(\"cron.end must not contain %q\", restrictedChars)\n\t}\n\n\treturn nil\n}\n\nfunc (t *TaskSchedule) Next(from time.Time) (start, end time.Duration, err error) {\n\treturn t.Cron.Next(from)\n}\n\ntype TaskScheduleCron struct {\n\t// Start is a stripped-down cron syntax, e.g.\n\t// \"0 30 9 * * MON-FRI *\"\n\t// is weekdays @ 09:30:00\n\tStart string\n\t// End is the end time in \"{minute} {hour}\" format, e.g.\n\t// \"30 9\"\n\t// is 09:30 AM\n\t// The End time *must* come after the Start time.","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/task_sched.go#L68-L104","documentation":"Returned by TaskSchedule.Validate when cron.end contains '/' or ',' (steps or lists). Schedule start/end expressions restrict those characters because the scheduler completes them into full cron expressions.","triggerScenarios":"Thrown at nomad/structs/task_sched.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use plain values in cron.end without '/' or ','","Split complex end schedules into simpler expressions"],"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"}