hashicorp/nomad · error

Specified job %q is stopped

Error message

Specified job %q is stopped

What it means

The parameterized job exists in the namespace but is marked stopped (Stop=true, e.g. it was deregistered or stopped via `nomad job stop`). Nomad refuses to dispatch children from a stopped parameterized job until the stop is purged or the job is re-registered.

Source

Thrown at nomad/job_endpoint.go:2031

	snap, err := j.srv.fsm.State().Snapshot()
	if err != nil {
		return err
	}
	ws := memdb.NewWatchSet()
	parameterizedJob, err := snap.JobByID(ws, args.RequestNamespace(), args.JobID)
	if err != nil {
		return err
	}
	if parameterizedJob == nil {
		return fmt.Errorf("parameterized job not found")
	}

	if !parameterizedJob.IsParameterized() {
		return fmt.Errorf("Specified job %q is not a parameterized job", args.JobID)
	}

	if parameterizedJob.Stop {
		return fmt.Errorf("Specified job %q is stopped", args.JobID)
	}

	// Set priority to match parent job if unset
	if args.Priority == 0 {
		args.Priority = parameterizedJob.Priority
	}

	// Validate the arguments and parameterized job
	agentConfig := j.srv.config
	if err := validateDispatchRequest(args, parameterizedJob, agentConfig); err != nil {
		return err
	}

	// Avoid creating new dispatched jobs for retried requests, by using the
	// idempotency token
	if args.IdempotencyToken != "" {
		found, err := snap.CheckIdempotencyToken(
			parameterizedJob.Namespace, parameterizedJob.ID, args.IdempotencyToken)

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Re-register / restart the parameterized job (`nomad job run` its spec) before dispatching
  2. If the stop was intentional, disable the dispatching automation
  3. Wait for GC and re-create the job fresh, then resume dispatch

Example fix

// before
nomad job dispatch batch-process
// after (job was stopped)
nomad system gc && nomad job run batch-process.nomad && nomad job dispatch batch-process
Defensive patterns

Strategy: validation

Validate before calling

job, _, _ := client.Jobs().Info(jobID, nil)
if job != nil && job.Status != nil && *job.Status == "dead" {
    return fmt.Errorf("job %s is stopped; re-register before dispatch", jobID)
}

Try / catch

if err != nil && strings.Contains(err.Error(), "is stopped") {
    // alert operator / halt automation instead of retrying
}

Prevention

When it happens

Trigger: Dispatching against a parameterized job that was stopped (job stop, deregister, or its dispatch deadline/gc passed and it is pending GC).

Common situations: CI pipelines still dispatching a job a teammate stopped; job stopped for maintenance but automation not paused; stopped jobs awaiting garbage collection still visible in listings, misleading scripts into trying dispatch.

Related errors


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