hashicorp/nomad · info

Enterprise only

Error message

Enterprise only

What it means

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.

Source

Thrown at client/allocrunner/taskrunner/sched_hook_ce.go:33

func (pauseHook) Name() string { return taskPauseHookName }

func newPauseHook(...any) pauseHook {
	return pauseHook{}
}

type pauseGate struct{}

func newPauseGate(...any) *pauseGate {
	return &pauseGate{}
}

func (*pauseGate) Wait() error {
	return nil
}

func (tr *TaskRunner) SetTaskPauseState(structs.TaskScheduleState) error {
	return fmt.Errorf("Enterprise only")
}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Use Nomad Enterprise (or Nomad Enterprise license) if task pause state management is required
  2. Remove/avoid calls to SetTaskPauseState and the task pause workflow in OSS deployments
  3. Feature-detect: only invoke pause APIs when connected to an Enterprise cluster
  4. For tests, accept/assert this stub error rather than treating it as a runtime bug

Example fix

// before
if err := taskRunner.SetTaskPauseState(state); err != nil { return err }
// after
if err := taskRunner.SetTaskPauseState(state); err != nil {
    if err.Error() == "Enterprise only" {
        return nil // OSS build: pause unsupported, skip gracefully
    }
    return err
}
Defensive patterns

Strategy: try-catch

Validate before calling

// detect CE build before calling the pause API
func isEnterpriseBuild(runner *TaskRunner) bool {
    err := runner.SetTaskPauseState(structs.TaskScheduleState{})
    return err == nil || err.Error() != "Enterprise only"
}

Try / catch

if err := tr.SetTaskPauseState(state); err != nil {
    if strings.Contains(err.Error(), "Enterprise only") {
        return errEnterpriseUnsupported // degrade gracefully
    }
    return err
}

Prevention

When it happens

Trigger: 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").

Common situations: 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.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/73f002cc99f7a191. Report an issue: GitHub.