hashicorp/nomad · error

Task group volume claim deletion failed: %v

Error message

Task group volume claim deletion failed: %v

What it means

Wraps a txn.Delete failure when removing a TaskGroupHostVolumeClaim during job cleanup. The iteration succeeded but deleting the specific claim row failed inside the delete-job transaction, which then aborts the whole job deregistration.

Source

Thrown at nomad/state/state_store_task_group_volume_claims.go:178

	if claim.ID != id || claim.Namespace != ns {
		return nil, nil
	}
	return claim, nil
}

// deleteTaskGroupHostVolumeClaimByNamespaceAndJob deletes all claims for a
// given namespace and job ID
func (s *StateStore) deleteTaskGroupHostVolumeClaimByNamespaceAndJob(index uint64, txn *txn, namespace, jobID string) error {
	iter, err := txn.Get(TableTaskGroupHostVolumeClaim, indexID)
	if err != nil {
		return fmt.Errorf("Task group volume claim lookup failed: %v", err)
	}

	for raw := iter.Next(); raw != nil; raw = iter.Next() {
		claim := raw.(*structs.TaskGroupHostVolumeClaim)
		if claim.JobID == jobID && claim.Namespace == namespace {
			if err := txn.Delete(TableTaskGroupHostVolumeClaim, claim); err != nil {
				return fmt.Errorf("Task group volume claim deletion failed: %v", err)
			}
		}
	}

	return nil
}

// DeleteTaskGroupHostVolumeClaim deletes a claim by its ID
func (s *StateStore) DeleteTaskGroupHostVolumeClaim(index uint64, ns, claimID string) error {
	txn := s.db.WriteTxnMsgT(structs.TaskGroupHostVolumeClaimDeleteRequestType, index)
	defer txn.Abort()

	obj, err := txn.First(TableTaskGroupHostVolumeClaim, indexClaimID, claimID)
	if err != nil {
		return fmt.Errorf("task group volume claim lookup failed: %v", err)
	}

	if obj == nil {

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Retry the job deletion
  2. Check server logs for the wrapped error to identify the memdb cause
  3. Restart the server to rebuild state from Raft
  4. Restore from a Raft snapshot if corruption is confirmed
Defensive patterns

Strategy: retry

Try / catch

if err := jobDeregister(...); err != nil {
    if strings.Contains(err.Error(), "volume claim deletion failed") {
        return retryAfterBackoff()
    }
    return err
}

Prevention

When it happens

Trigger: Deleting a job that has sticky host-volume claims, when txn.Delete on a matched claim errors (store corruption or txn-level constraint).

Common situations: State-store corruption; Raft apply failures mid-deregistration; internal Nomad bugs in claim table maintenance.

Related errors


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