{"record":{"id":"871f0a1e822954ab","repo":"hashicorp/nomad","slug":"index-update-failed-v-871f0a","errorCode":null,"errorMessage":"index update failed: %v","messagePattern":"index update failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"nomad/state/state_store_task_group_volume_claims.go","lineNumber":63,"sourceCode":"\t\tif existing.ClaimedByAlloc(claim) {\n\t\t\treturn nil\n\t\t}\n\n\t\tclaim.CreateIndex = existing.CreateIndex\n\t\tclaim.ModifyIndex = index\n\t} else {\n\t\tclaim.CreateIndex = index\n\t\tclaim.ModifyIndex = index\n\t}\n\n\t// Insert the claim into the table.\n\tif err := txn.Insert(TableTaskGroupHostVolumeClaim, claim); err != nil {\n\t\treturn fmt.Errorf(\"Task group volume claim insert failed: %v\", err)\n\t}\n\n\t// Perform the index table update to mark the new insert.\n\tif err := txn.Insert(tableIndex, &IndexEntry{TableTaskGroupHostVolumeClaim, index}); err != nil {\n\t\treturn fmt.Errorf(\"index update failed: %v\", err)\n\t}\n\n\treturn nil\n}\n\n// GetTaskGroupHostVolumeClaim returns a volume claim that matches the namespace,\n// job id and task group name (there can be only one)\nfunc (s *StateStore) GetTaskGroupHostVolumeClaim(ws memdb.WatchSet, namespace, jobID, taskGroupName, volumeID string) (*structs.TaskGroupHostVolumeClaim, error) {\n\ttxn := s.db.ReadTxn()\n\n\twatchCh, existing, err := txn.FirstWatch(TableTaskGroupHostVolumeClaim, indexID, namespace, jobID, taskGroupName, volumeID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Task group volume claim lookup failed: %v\", err)\n\t}\n\tws.Add(watchCh)\n\n\tif existing != nil {\n\t\treturn existing.(*structs.TaskGroupHostVolumeClaim), nil","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store_task_group_volume_claims.go#L45-L81","documentation":"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.","triggerScenarios":"txn.Insert(tableIndex, &IndexEntry{...}) errors inside upsertTaskGroupHostVolumeClaimImpl, immediately after a successful claim insert; the whole txn aborts.","commonSituations":"Corrupted state store index tables; Nomad internal bugs; resource exhaustion on the server.","solutions":["Retry the request; the aborted txn left no partial state","Inspect server logs for the wrapped memdb error (%v) to find the root cause","Restart/rebuild the server from a Raft snapshot if index tables are corrupt","File/upgrade via Nomad releases if reproducible on a supported version"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := store.UpsertTaskGroupHostVolumeClaim(idx, claims); err != nil {\n    if strings.Contains(err.Error(), \"index update failed\") {\n        return retryAfterBackoff()\n    }\n    return err\n}","preventionTips":["Monitor server health; index write failures indicate store corruption","Restart servers from Raft snapshots if index errors recur","Report persistent occurrences to Nomad with server logs"],"tags":["nomad","state-store","memdb","index"],"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"}