hashicorp/nomad · error

Task group volume claim lookup failed: %v

Error message

Task group volume claim lookup failed: %v

What it means

Wraps a memdb error from txn.FirstWatch while fetching a single TaskGroupHostVolumeClaim by (namespace, jobID, taskGroupName, volumeID). It means the read transaction itself failed, not that the claim is missing (missing claims return nil, nil). Read failures here are rare and indicate store-internal problems.

Source

Thrown at nomad/state/state_store_task_group_volume_claims.go:76

		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
	}

	return nil, nil
}

// GetTaskGroupHostVolumeClaims returns all volume claims
func (s *StateStore) GetTaskGroupHostVolumeClaims(ws memdb.WatchSet) (memdb.ResultIterator, error) {
	txn := s.db.ReadTxn()

	iter, err := txn.Get(TableTaskGroupHostVolumeClaim, indexID)
	if err != nil {
		return nil, fmt.Errorf("Task group volume claim lookup failed: %v", err)
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Retry the read; transient txn errors are rare but possible
  2. Check server logs for the underlying memdb error
  3. Restart the Nomad server to reload state from Raft
  4. Verify no external tooling mutated the data directory while the server was running
Defensive patterns

Strategy: try-catch

Try / catch

claim, err := store.GetTaskGroupHostVolumeClaim(ws, ns, jobID, tgName, volID)
if err != nil {
    if strings.Contains(err.Error(), "lookup failed") {
        return retryRead()
    }
    return err
}
if claim == nil { /* not found — handle normally */ }

Prevention

When it happens

Trigger: Calling StateStore.GetTaskGroupHostVolumeClaim when the underlying read txn's FirstWatch on the claim table errors (corrupt index or table).

Common situations: Corrupted in-memory store after a crash; bugs in memdb index definitions; rarely seen in healthy clusters.

Related errors


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