{"record":{"id":"7a1c00143455a318","repo":"hashicorp/nomad","slug":"task-group-volume-claim-lookup-failed-v-7a1c00","errorCode":null,"errorMessage":"task group volume claim lookup failed: %v","messagePattern":"task group volume claim lookup failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store_task_group_volume_claims.go","lineNumber":193,"sourceCode":"\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 {\n\t\treturn errors.New(\"task group volume claim does not exist\")\n\t}\n\tclaim := obj.(*structs.TaskGroupHostVolumeClaim)\n\tif claim.Namespace != ns {\n\t\treturn errors.New(\"task group volume claim does not exist\")\n\t}\n\n\tif err := txn.Delete(TableTaskGroupHostVolumeClaim, obj); err != nil {\n\t\treturn err\n\t}\n\n\tif err := txn.Insert(tableIndex, &IndexEntry{TableTaskGroupHostVolumeClaim, index}); err != nil {\n\t\treturn fmt.Errorf(\"index update failed: %w\", err)\n\t}\n","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store_task_group_volume_claims.go#L175-L211","documentation":"Wraps a txn.First failure when looking up a single claim by claimID before deletion in DeleteTaskGroupHostVolumeClaim. Note the lowercase 'task group' here distinguishes it from the other lookup errors in the same file. This is a storage-layer failure; a simply missing claim instead returns 'task group volume claim does not exist'.","triggerScenarios":"Calling DeleteTaskGroupHostVolumeClaim (via applyTaskGroupHostVolumeClaimDelete / the claim-delete Raft message) when the id lookup errors in memdb.","commonSituations":"Corrupted state store; allocation garbage-collection running against an unhealthy server; memdb index problems.","solutions":["Retry the deletion; aborted txns leave state consistent","Check server logs for the underlying memdb error","Restart the server to reload state","Restore from Raft snapshot if corruption persists"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := deleteClaim(claimID); err != nil {\n    switch {\n    case strings.Contains(err.Error(), \"does not exist\"):\n        return nil // idempotent success\n    case strings.Contains(err.Error(), \"lookup failed\"):\n        return retryAfterBackoff()\n    default:\n        return err\n    }\n}","preventionTips":["Distinguish 'lookup failed' (storage error, retryable) from 'does not exist' (idempotent success)","Check server health when claim reads fail","Keep Nomad patched to the latest stable release"],"tags":["nomad","state-store","volume-claims","delete"],"backgroundTag":"state-store-read-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}