hashicorp/nomad · error

Specified job %q is not a parameterized job

Error message

Specified job %q is not a parameterized job

What it means

The job was found by ID, but its ParameterizedJob block is not configured, so IsParameterized() returns false. Dispatch only works on parameterized jobs; a regular batch/service job cannot be dispatched.

Source

Thrown at nomad/job_endpoint.go:2027

	if args.JobID == "" {
		return fmt.Errorf("missing parameterized job ID")
	}

	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

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Add a `parameterized` stanza to the job spec and resubmit it, or use `nomad job periodic` if it is a periodic job
  2. Use the correct job that is actually parameterized
  3. For periodic jobs, use `nomad job periodic <job-id>` instead of dispatch

Example fix

// before (job has no parameterized stanza)
job "batch" { type = "batch" }
// after
job "batch" {
  type = "batch"
  parameterized {
    payload       = "optional"
    meta_required = ["run_id"]
  }
}
Defensive patterns

Strategy: validation

Validate before calling

job, _, _ := client.Jobs().Info(jobID, nil)
if job == nil || job.ParameterizedJob == nil {
    return fmt.Errorf("%s is not a parameterized job; use dispatch only on parameterized jobs", jobID)
}

Type guard

func isParameterized(j *api.Job) bool { return j != nil && j.ParameterizedJob != nil }

Prevention

When it happens

Trigger: Calling Dispatch (or `nomad job dispatch`) on a normal job that has no `parameterized` stanza in its job spec.

Common situations: Copy-pasting a dispatch command meant for one job onto a regular job; a job spec was edited and the parameterized stanza removed while scripts still dispatch it; confusion between periodic and parameterized jobs (periodic jobs use `nomad job periodic`, not dispatch).

Related errors


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