hashicorp/nomad · critical

index update failed: %v

Error message

index update failed: %v

What it means

Wraps a memdb failure while updating the index table entry for TableTaskGroupHostVolumeClaim after inserting a claim. Index rows track Raft indexes per table; without this update, blocking queries and index consistency break. Failure indicates a low-level store/txn problem, not a user-input problem.

Source

Thrown at nomad/state/state_store_task_group_volume_claims.go:63

		if existing.ClaimedByAlloc(claim) {
			return nil
		}

		claim.CreateIndex = existing.CreateIndex
		claim.ModifyIndex = index
	} else {
		claim.CreateIndex = index
		claim.ModifyIndex = index
	}

	// Insert the claim into the table.
	if err := txn.Insert(TableTaskGroupHostVolumeClaim, claim); err != nil {
		return fmt.Errorf("Task group volume claim insert failed: %v", err)
	}

	// Perform the index table update to mark the new insert.
	if err := txn.Insert(tableIndex, &IndexEntry{TableTaskGroupHostVolumeClaim, index}); err != nil {
		return fmt.Errorf("index update failed: %v", err)
	}

	return nil
}

// GetTaskGroupHostVolumeClaim returns a volume claim that matches the namespace,
// job id and task group name (there can be only one)
func (s *StateStore) GetTaskGroupHostVolumeClaim(ws memdb.WatchSet, namespace, jobID, taskGroupName, volumeID string) (*structs.TaskGroupHostVolumeClaim, error) {
	txn := s.db.ReadTxn()

	watchCh, existing, err := txn.FirstWatch(TableTaskGroupHostVolumeClaim, indexID, namespace, jobID, taskGroupName, volumeID)
	if err != nil {
		return nil, fmt.Errorf("Task group volume claim lookup failed: %v", err)
	}
	ws.Add(watchCh)

	if existing != nil {
		return existing.(*structs.TaskGroupHostVolumeClaim), nil

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Retry the request; the aborted txn left no partial state
  2. Inspect server logs for the wrapped memdb error (%v) to find the root cause
  3. Restart/rebuild the server from a Raft snapshot if index tables are corrupt
  4. File/upgrade via Nomad releases if reproducible on a supported version
Defensive patterns

Strategy: retry

Try / catch

if err := store.UpsertTaskGroupHostVolumeClaim(idx, claims); err != nil {
    if strings.Contains(err.Error(), "index update failed") {
        return retryAfterBackoff()
    }
    return err
}

Prevention

When it happens

Trigger: txn.Insert(tableIndex, &IndexEntry{...}) errors inside upsertTaskGroupHostVolumeClaimImpl, immediately after a successful claim insert; the whole txn aborts.

Common situations: Corrupted state store index tables; Nomad internal bugs; resource exhaustion on the server.

Related errors


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