{"record":{"id":"fdf28ccfd884cee8","repo":"hashicorp/nomad","slug":"invalid-timezone-in-schedule-w","errorCode":null,"errorMessage":"invalid timezone in schedule: %w","messagePattern":"invalid timezone in schedule: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/task_sched.go","lineNumber":128,"sourceCode":"}\n\nfunc (t TaskScheduleCron) String() string {\n\treturn fmt.Sprintf(\"<Start='%s', End='%s', Timezone='%s'>\",\n\t\tt.Start, t.End, t.Timezone)\n}\n\nfunc (t TaskScheduleCron) GetTimezone() string {\n\tif t.Timezone == \"\" {\n\t\treturn \"Local\" // https://pkg.go.dev/time#LoadLocation\n\t}\n\treturn t.Timezone\n}\n\nfunc (t TaskScheduleCron) Next(from time.Time) (time.Duration, time.Duration, error) {\n\t// where are we?\n\tlocation, err := time.LoadLocation(t.GetTimezone())\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"invalid timezone in schedule: %w\", err)\n\t}\n\tfrom = from.In(location)\n\n\t// values should be pre-validated by this point\n\tstart, err := cronexpr.Parse(t.Start)\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"invalid start time in schedule: %q; %w\", t.Start, err)\n\t}\n\t// get end time for prev to see if we're within the run schedule,\n\t// and from next to get the next pause time.\n\tend, err := cronexpr.Parse(t.End + \" * * * *\") // TODO: if we want to exclude seconds, prefix \"* \" + t.End here\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"invalid end time in schedule: %q; %w\", t.End, err)\n\t}\n\n\tstartNext := start.Next(from)\n\t// we'll check the previous start to see if we are currently between it\n\t// and the previous run's end, i.e. it should be running right now!","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/task_sched.go#L110-L146","documentation":"Returned by TaskScheduleCron.Next when time.LoadLocation fails on the schedule's timezone (or the \"Local\" default). The IANA timezone name is unknown on this system, so times cannot be computed in it.","triggerScenarios":"Thrown at nomad/structs/task_sched.go:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid IANA timezone name such as \"America/New_York\"","Ensure tzdata is installed (or import _ \"time/tzdata\" in the binary) when running in minimal containers"],"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"}