hashicorp/nomad · error

missing parameterized job ID

Error message

missing parameterized job ID

What it means

Dispatch is the RPC endpoint that launches a child job (dispatch instance) from a parameterized job. Before looking up the job in state store, it requires args.JobID to be non-empty. An empty JobID means the client submitted a dispatch request without identifying which parameterized job to dispatch, so the server cannot proceed.

Source

Thrown at nomad/job_endpoint.go:2010

	}
	defer metrics.MeasureSince([]string{"nomad", "job", "dispatch"}, time.Now())

	// Check for submit-job permissions
	aclObj, err := j.srv.ResolveACL(args)
	if err != nil {
		return err
	} else if !aclObj.AllowNsOp(args.RequestNamespace(), acl.NamespaceCapabilityDispatchJob) {
		return structs.ErrPermissionDenied
	}

	if ok, err := registrationsAreAllowed(aclObj, j.srv.State()); !ok || err != nil {
		j.logger.Warn("job dispatch is currently disabled for non-management ACL")
		return structs.ErrJobRegistrationDisabled
	}

	// Lookup the parameterized job
	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)
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Pass the parameterized job ID in the dispatch request (JobDispatchRequest.JobID)
  2. If using the CLI, supply the job ID as the first argument: `nomad job dispatch <job-id>`
  3. Verify the ID is not lost in templating/config before calling Dispatch

Example fix

// before
req := &structs.JobDispatchRequest{}
// after
req := &structs.JobDispatchRequest{JobID: "batch-process"}
Defensive patterns

Strategy: validation

Validate before calling

if req.JobID == "" {
    return fmt.Errorf("dispatch requires a JobID")
}

Prevention

When it happens

Trigger: Calling the JobDispatch RPC (or `nomad job dispatch ''` / client.Dispatch with JobID set to "") without setting the JobID field on structs.JobDispatchRequest.

Common situations: Programmatic dispatch where the job ID variable was never populated or was overwritten by an empty result from config/templating; CLI wrappers that fail to forward a positional argument; API clients building the request struct manually and forgetting the ID field.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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