{"record":{"id":"82c9c7378d1bbbbd","repo":"temporalio/temporal","slug":"out-of-range","errorCode":null,"errorMessage":"out of range","messagePattern":"out of range","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/worker/scheduler/calendar.go","lineNumber":53,"sourceCode":"\tmaxCalendarYear = 2100\n\n\t// max length of one calendar comment field\n\tmaxCommentLen = 200\n)\n\nconst (\n\t// Modes for parsing range strings: all modes accept decimal integers\n\tparseModeInt parseMode = iota\n\t// parseModeYear is like parseModeInt but returns an empty range for the default\n\tparseModeYear\n\t// parseModeMonth also accepts month name prefixes (at least three letters)\n\tparseModeMonth\n\t// parseModeDow also accepts day-of-week prefixes (at least two letters)\n\tparseModeDow\n)\n\nvar (\n\terrOutOfRange               = errors.New(\"out of range\")\n\terrConflictingTimezoneNames = errors.New(\"conflicting timezone names\")\n\n\tmonthStrings = []string{\n\t\t\"january\",\n\t\t\"february\",\n\t\t\"march\",\n\t\t\"april\",\n\t\t\"may\",\n\t\t\"june\",\n\t\t\"july\",\n\t\t\"august\",\n\t\t\"september\",\n\t\t\"october\",\n\t\t\"november\",\n\t\t\"december\",\n\t}\n\n\tdowStrings = []string{","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/worker/scheduler/calendar.go#L35-L71","documentation":"errOutOfRange is returned by calendar spec parsing helpers (parseValue/makeRange) when a numeric or named component of a Schedule calendar spec or cron string falls outside the field's allowed bounds — e.g. minute 61, month 13, day-of-month 32, or a year outside minCalendarYear..maxCalendarYear. It is aggregated by parseCalendarToStructured into a combined error listing every invalid field.","triggerScenarios":"Creating/updating a Temporal Schedule (or starting a scheduler workflow) whose CalendarSpec or cron string contains a value exceeding the field's range: Second>59, Minute>59, Hour>23, DayOfMonth>31, Month>12, DayOfWeek>7, or Year outside the supported window.","commonSituations":"Hand-writing cron/calendar expressions and transposing digits; using 1-based day-of-week in a field expecting 0-based (0-7); scripts generating specs with off-by-one bounds; localizing month names that the parser doesn't recognize and mis-sizes.","solutions":["Read the field names in the joined error message and clamp each component to its valid range (Second 0-59, Minute 0-59, Hour 0-23, DayOfMonth 1-31, Month 1-12, DayOfWeek 0-7).","Validate the cron/calendar string with a standard cron parser or the Temporal CLI before applying it to the schedule.","Prefer month/day names or the structured CalendarSpec API over raw integers to avoid off-by-one errors.","Check the Year field is within minCalendarYear..maxCalendarYear if a year is specified."],"exampleFix":"// before\nspec := &schedulepb.CalendarSpec{Minute: \"61\", Hour: \"9\"} // minute out of range\n// after\nspec := &schedulepb.CalendarSpec{Minute: \"0\", Hour: \"9\"}","handlingStrategy":"validation","validationCode":"func checkRange(field string, v, min, max int) error {\n\tif v < min || v > max {\n\t\treturn fmt.Errorf(\"%s %d out of range [%d,%d]\", field, v, min, max)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"spec, err := schedule.NewCalendarSpec(...) // or update via CLI\nif err != nil && strings.Contains(err.Error(), \"out of range\") {\n\t// clamp fields and resubmit\n}","preventionTips":["Use named values (MON, JAN) or the structured spec API to avoid 0/1-based confusion.","Sanity-check every numeric field: Second 0-59, Minute 0-59, Hour 0-23, DayOfMonth 1-31, Month 1-12, DayOfWeek 0-7.","Lint cron strings with a standard parser before applying schedules."],"tags":["scheduler","calendar-spec","validation","go"],"backgroundTag":"schedule-spec-out-of-range","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}