{"record":{"id":"0fc9e9f0ac0e2045","repo":"hashicorp/nomad","slug":"task-schedules-requires-nomad-enterprise","errorCode":null,"errorMessage":"task schedules requires Nomad Enterprise","messagePattern":"task schedules requires Nomad Enterprise","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint_hook_sched_ce.go","lineNumber":18,"sourceCode":"// Copyright IBM Corp. 2015, 2026\n// SPDX-License-Identifier: BUSL-1.1\n\n//go:build !ent\n\npackage nomad\n\nimport (\n\t\"errors\"\n\n\t\"github.com/hashicorp/nomad/nomad/structs\"\n)\n\nfunc (jobSchedHook) Validate(job *structs.Job) ([]error, error) {\n\tfor _, tg := range job.TaskGroups {\n\t\tfor _, task := range tg.Tasks {\n\t\t\tif task.Schedule != nil {\n\t\t\t\treturn nil, errors.New(\"task schedules requires Nomad Enterprise\")\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, nil\n}\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint_hook_sched_ce.go#L1-L24","documentation":"Task schedules (cron-like scheduling of task start/stop inside allocations) are a Nomad Enterprise feature. The CE jobSchedHook Validate hook returns this error if any task in the job has a non-nil schedule block.","triggerScenarios":"Submitting a job where a task contains a `schedule { ... }` block (e.g. `schedule { cron = \"...\" }`) on a Nomad OSS server.","commonSituations":"Copying an Enterprise job spec to CE; trying out task cron scheduling on OSS without a license.","solutions":["Remove the `schedule` block from the task.","Upgrade to Nomad Enterprise for task scheduling.","Use an external scheduler (system cron triggering `nomad job run`) instead."],"exampleFix":"// before\ntask \"web\" {\n  schedule {\n    cron = \"0 * * * *\"\n  }\n}\n\n// after\ntask \"web\" {\n}","handlingStrategy":"validation","validationCode":"if task.Schedule != nil {\n  return errors.New(\"task schedules requires Nomad Enterprise\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid schedule blocks on OSS clusters","Use external cron tooling as an OSS alternative","Check feature availability per edition before adopting new HCL blocks"],"tags":["nomad","task-schedule","enterprise-only","job-validation"],"backgroundTag":"nomad-enterprise-feature-required","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"}