hashicorp/nomad · error

failed to get job deployment %q: %v

Error message

failed to get job deployment %q: %v

What it means

For non-batch (service/system) jobs, process() fetches the job's latest deployment via StateStore.LatestDeploymentByJobID to feed the deployment reconciler. A state store error (not absence of deployments) aborts processing with this wrapped error.

Source

Thrown at scheduler/generic_sched.go:228

		return false, fmt.Errorf("failed to get job %q: %v", s.eval.JobID, err)
	}

	numTaskGroups := 0
	stopped := s.job.Stopped()
	if !stopped {
		numTaskGroups = len(s.job.TaskGroups)
	}
	s.queuedAllocs = make(map[string]int, numTaskGroups)
	s.followUpEvals = nil

	// Create a plan
	s.plan = s.eval.MakePlan(s.job)

	if !s.batch {
		// Get any existing deployment
		s.deployment, err = s.state.LatestDeploymentByJobID(ws, s.eval.Namespace, s.eval.JobID)
		if err != nil {
			return false, fmt.Errorf("failed to get job deployment %q: %v", s.eval.JobID, err)
		}
		s.deployment = s.deployment.Copy() // may mutate in reconciler
	}

	// Reset the failed allocations
	s.failedTGAllocs = nil

	// Create an evaluation context
	s.ctx = feasible.NewEvalContext(s.eventsCh, s.state, s.plan, s.logger)

	// Construct the placement stack
	s.stack = feasible.NewGenericStack(s.batch, s.ctx)
	if !s.job.Stopped() {
		s.setJob(s.job)
	}

	// Compute the target job allocations
	if err := s.computeJobAllocs(); err != nil {

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Check the wrapped underlying error in logs for the root cause
  2. Retry the eval; Nomad will reprocess failed evaluations
  3. Verify state store / raft health and restore from snapshot if needed
  4. Temporarily pause deployments until server stability is restored
Defensive patterns

Strategy: retry

Validate before calling

nomad deployment list // verify deployments are queryable and the server responds

Try / catch

// Server-internal error: inspect wrapped cause in logs, retry via eval reprocessing
nomad deployment list
nomad eval list | grep -i failed

Prevention

When it happens

Trigger: StateStore.LatestDeploymentByJobID errors during process() for a service job eval — state store failure, snapshot invalidation, internal memdb error.

Common situations: Server state store instability during deployments, raft restore in progress, resource pressure on the Nomad server.

Related errors


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