{"record":{"id":"73f002cc99f7a191","repo":"hashicorp/nomad","slug":"enterprise-only-73f002","errorCode":null,"errorMessage":"Enterprise only","messagePattern":"Enterprise only","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"client/allocrunner/taskrunner/sched_hook_ce.go","lineNumber":33,"sourceCode":"\nfunc (pauseHook) Name() string { return taskPauseHookName }\n\nfunc newPauseHook(...any) pauseHook {\n\treturn pauseHook{}\n}\n\ntype pauseGate struct{}\n\nfunc newPauseGate(...any) *pauseGate {\n\treturn &pauseGate{}\n}\n\nfunc (*pauseGate) Wait() error {\n\treturn nil\n}\n\nfunc (tr *TaskRunner) SetTaskPauseState(structs.TaskScheduleState) error {\n\treturn fmt.Errorf(\"Enterprise only\")\n}\n","sourceCodeStart":15,"sourceCodeEnd":35,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/taskrunner/sched_hook_ce.go#L15-L35","documentation":"This is the open-source (CE) stub of TaskRunner.SetTaskPauseState. Task pause/resume scheduling (set_task_pause_state on the task runner) is an Enterprise-only Nomad feature, so the CE build returns this fixed error whenever the API is invoked.","triggerScenarios":"Calling SetTaskPauseState (e.g. via an API or internal code path that pauses a task's schedule) on a Nomad client/agent binary built from the open-source repository; the function ignores its TaskScheduleState argument and immediately returns fmt.Errorf(\"Enterprise only\").","commonSituations":"A developer running Nomad OSS calls an Enterprise-only scheduling API (task pause/unpause, maintenance schedules); automation built against Nomad Enterprise is pointed at an OSS cluster; tests invoking the CE hook binary (sched_hook_ce.go) exercise the stub.","solutions":["Use Nomad Enterprise (or Nomad Enterprise license) if task pause state management is required","Remove/avoid calls to SetTaskPauseState and the task pause workflow in OSS deployments","Feature-detect: only invoke pause APIs when connected to an Enterprise cluster","For tests, accept/assert this stub error rather than treating it as a runtime bug"],"exampleFix":"// before\nif err := taskRunner.SetTaskPauseState(state); err != nil { return err }\n// after\nif err := taskRunner.SetTaskPauseState(state); err != nil {\n    if err.Error() == \"Enterprise only\" {\n        return nil // OSS build: pause unsupported, skip gracefully\n    }\n    return err\n}","handlingStrategy":"try-catch","validationCode":"// detect CE build before calling the pause API\nfunc isEnterpriseBuild(runner *TaskRunner) bool {\n    err := runner.SetTaskPauseState(structs.TaskScheduleState{})\n    return err == nil || err.Error() != \"Enterprise only\"\n}","typeGuard":null,"tryCatchPattern":"if err := tr.SetTaskPauseState(state); err != nil {\n    if strings.Contains(err.Error(), \"Enterprise only\") {\n        return errEnterpriseUnsupported // degrade gracefully\n    }\n    return err\n}","preventionTips":["Only use task pause APIs against Nomad Enterprise clusters","Version/feature-check the cluster before issuing Enterprise-only RPCs","Document pause workflows as Enterprise-only for operator tooling","Keep CE stub expectations in tests so OSS builds fail predictably"],"tags":["nomad","enterprise-only","unsupported-api","licensing"],"backgroundTag":"enterprise-feature-unavailable","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"}