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 jobsView on GitHub (pinned to 482b49bf1a)
Solutions
- Retry the job submit (nomad job run / API) — the atomic abort leaves consistent state for a clean retry
- Check server logs for the wrapped inner error to distinguish memdb corruption from logic bugs
- Restore server state from a raft snapshot if job registrations repeatedly fail with insert errors
- 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
- Retry job registration after backoff — aborted transactions leave consistent state
- Watch for a pattern: failures only on periodic/parameterized (parent) jobs points to this code path
- Restore from raft snapshot if job_summary inserts fail persistently
- Keep the inner error from logs for upstream bug reports
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
- unable to find task group in the job summary: %v
- error querying plugin %q: %v
- index update failed: %v
- JobByID lookup failed: %w
- UpsertJob failed: %w
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/d2857db4c100e027.
Report an issue: GitHub.