hashicorp/nomad · error

error inserting job summary: %v

Error message

error inserting job summary: %v

What it means

In upsertJobImpl (parent-job branch, e.g. parameterized/periodic multiregion handling), the store inserts a freshly built JobSummary into the job_summary table; this error wraps a failed txn.Insert("job_summary", summary). The summary tracks allocation counts per task group for the scheduler. The Raft transaction aborts, so the job registration that this belongs to is also rejected.

Source

Thrown at nomad/state/state_store.go:5370

				switch childJob.Status {
				case structs.JobStatusPending:
					summary.Children.Pending++
				case structs.JobStatusDead:
					summary.Children.Dead++
				case structs.JobStatusRunning:
					summary.Children.Running++
				}
			}

			// Insert the job summary if its different
			if !reflect.DeepEqual(summary, oldSummary) {
				// Set the create index of the summary same as the job's create index
				// and the modify index to the current index
				summary.CreateIndex = job.CreateIndex
				summary.ModifyIndex = index

				if err := txn.Insert("job_summary", summary); err != nil {
					return fmt.Errorf("error inserting job summary: %v", err)
				}
			}

			// Done with handling a parent job, continue to next
			continue
		}

		// Create a job summary for the job
		summary := &structs.JobSummary{
			JobID:     job.ID,
			Namespace: job.Namespace,
			Summary:   make(map[string]structs.TaskGroupSummary),
		}
		for _, tg := range job.TaskGroups {
			summary.Summary[tg.Name] = structs.TaskGroupSummary{}
		}

		// Find all the allocations for the jobs

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Retry the job submit (nomad job run / API) — the atomic abort leaves consistent state for a clean retry
  2. Check server logs for the wrapped inner error to distinguish memdb corruption from logic bugs
  3. Restore server state from a raft snapshot if job registrations repeatedly fail with insert errors
  4. Upgrade Nomad if the inner error matches a known state-store bug in your version
Defensive patterns

Strategy: retry

Try / catch

err := store.UpsertJob(idx, job)
if err != nil && strings.Contains(err.Error(), "error inserting job summary") {
	return retryWithBackoff(3, time.Second, func() error {
		return store.UpsertJob(idx, job)
	})
}

Prevention

When it happens

Trigger: Job registration/upsert where creating the job summary row for a parent job fails in memdb (summary insert error).

Common situations: memdb write failure on the leader; corrupted job_summary table after crash; Nomad version-specific memdb bugs during job registration of periodic/parameterized jobs.

Related errors


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