hashicorp/nomad · error

setting job status for %q failed: %v

Error message

setting job status for %q failed: %v

What it means

While upserting the job, computing its status via getJobStatus returned an error; the wrapped failure happens during state-derived status calculation (e.g. reading evals/allocs) and aborts the registration.

Source

Thrown at nomad/state/state_store.go:1862

		// when changing an internal field such as Stable. A spec change should
		// always come with a version bump
		if !keepVersion {
			job.JobModifyIndex = index
			if job.Version <= existingJob.Version {
				if sub == nil {
					// in the reversion case we must set the submission to be
					// that of the job version we are reverting to
					sub, _ = s.jobSubmission(nil, job.Namespace, job.ID, job.Version, txn)
				}
				job.Version = existingJob.Version + 1
			}
		}

		// Compute the job status
		var err error
		job.Status, err = s.getJobStatus(txn, job, false)
		if err != nil {
			return fmt.Errorf("setting job status for %q failed: %v", job.ID, err)
		}
	} else {
		job.CreateIndex = index
		job.ModifyIndex = index
		job.JobModifyIndex = index

		if err := s.setJobStatus(index, txn, job, false, ""); err != nil {
			return fmt.Errorf("setting job status for %q failed: %v", job.ID, err)
		}

		// Have to get the job again since it could have been updated
		updated, err := txn.First("jobs", "id", job.Namespace, job.ID)
		if err != nil {
			return fmt.Errorf("job lookup failed: %v", err)
		}
		if updated != nil {
			job = updated.(*structs.Job)
		}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Retry the job registration
  2. Inspect server logs for the underlying state store read error
  3. Verify cluster/state health if it persists
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at nomad/state/state_store.go:1862 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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