hashicorp/nomad · error

parameterized job not found

Error message

parameterized job not found

What it means

After the JobID is validated, Dispatch looks up the job in the request's namespace via state store snap.JobByID. If no job with that ID exists in that namespace, the lookup returns nil and the server rejects the dispatch with this error.

Source

Thrown at nomad/job_endpoint.go:2023

		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)
	}

	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 {

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Check `nomad job status <job-id>` in the target namespace to confirm the parameterized job exists
  2. Verify the request namespace (and ACL token namespace) matches the namespace where the job is registered
  3. Re-register the parameterized job if it was stopped and garbage collected
  4. Correct the job ID spelling in your dispatch call

Example fix

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

Strategy: validation

Validate before calling

job, _, err := client.Jobs().Info(jobID, &nomad.QueryOptions{Namespace: ns})
if err != nil || job == nil {
    return fmt.Errorf("parameterized job %q not found in namespace %s", jobID, ns)
}

Try / catch

if err != nil && strings.Contains(err.Error(), "parameterized job not found") {
    // re-register the job or fail fast; retrying will not help
}

Prevention

When it happens

Trigger: Dispatching against a JobID that does not exist in the request namespace: job never registered, already GC'd, typo in the ID, or dispatching into the wrong namespace (RequestNamespace differs from where the job lives).

Common situations: Automated pipelines dispatching jobs that were garbage collected after their stop-time/dispatch deadline; multi-namespace setups where ACL token resolves to a different namespace than where the job was created; typos or renamed jobs in CI scripts.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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