{"record":{"id":"383cf15284b15742","repo":"hashicorp/nomad","slug":"task-group-volume-claim-deletion-failed-v","errorCode":null,"errorMessage":"Task group volume claim deletion failed: %v","messagePattern":"Task group volume claim deletion failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store_task_group_volume_claims.go","lineNumber":178,"sourceCode":"\tif claim.ID != id || claim.Namespace != ns {\n\t\treturn nil, nil\n\t}\n\treturn claim, nil\n}\n\n// deleteTaskGroupHostVolumeClaimByNamespaceAndJob deletes all claims for a\n// given namespace and job ID\nfunc (s *StateStore) deleteTaskGroupHostVolumeClaimByNamespaceAndJob(index uint64, txn *txn, namespace, jobID string) error {\n\titer, err := txn.Get(TableTaskGroupHostVolumeClaim, indexID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Task group volume claim lookup failed: %v\", err)\n\t}\n\n\tfor raw := iter.Next(); raw != nil; raw = iter.Next() {\n\t\tclaim := raw.(*structs.TaskGroupHostVolumeClaim)\n\t\tif claim.JobID == jobID && claim.Namespace == namespace {\n\t\t\tif err := txn.Delete(TableTaskGroupHostVolumeClaim, claim); err != nil {\n\t\t\t\treturn fmt.Errorf(\"Task group volume claim deletion failed: %v\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// DeleteTaskGroupHostVolumeClaim deletes a claim by its ID\nfunc (s *StateStore) DeleteTaskGroupHostVolumeClaim(index uint64, ns, claimID string) error {\n\ttxn := s.db.WriteTxnMsgT(structs.TaskGroupHostVolumeClaimDeleteRequestType, index)\n\tdefer txn.Abort()\n\n\tobj, err := txn.First(TableTaskGroupHostVolumeClaim, indexClaimID, claimID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"task group volume claim lookup failed: %v\", err)\n\t}\n\n\tif obj == nil {","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store_task_group_volume_claims.go#L160-L196","documentation":"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.","triggerScenarios":"Deleting a job that has sticky host-volume claims, when txn.Delete on a matched claim errors (store corruption or txn-level constraint).","commonSituations":"State-store corruption; Raft apply failures mid-deregistration; internal Nomad bugs in claim table maintenance.","solutions":["Retry the job deletion","Check server logs for the wrapped error to identify the memdb cause","Restart the server to rebuild state from Raft","Restore from a Raft snapshot if corruption is confirmed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := jobDeregister(...); err != nil {\n    if strings.Contains(err.Error(), \"volume claim deletion failed\") {\n        return retryAfterBackoff()\n    }\n    return err\n}","preventionTips":["Retry deregistration on failure — no partial deletes persist","Investigate the wrapped memdb error in logs","Maintain Raft snapshots for recovery"],"tags":["nomad","state-store","volume-claims","job-deregister"],"backgroundTag":"state-store-write-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}