{"record":{"id":"c2c25c3b519e8741","repo":"hashicorp/nomad","slug":"index-update-failed-v-c2c25c","errorCode":null,"errorMessage":"index update failed: %v","messagePattern":"index update failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store_acl.go","lineNumber":75,"sourceCode":"\tfor _, role := range roles {\n\n\t\troleUpdated, err := s.upsertACLRoleTxn(index, txn, role, allowMissingPolicies)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Ensure we track whether any inserts have been made.\n\t\tupdated = updated || roleUpdated\n\t}\n\n\t// If we did not perform any inserts, exit early.\n\tif !updated {\n\t\treturn nil\n\t}\n\n\t// Perform the index table update to mark the new insert.\n\tif err := txn.Insert(tableIndex, &IndexEntry{TableACLRoles, index}); err != nil {\n\t\treturn fmt.Errorf(\"index update failed: %v\", err)\n\t}\n\n\treturn txn.Commit()\n}\n\n// upsertACLRoleTxn inserts a single ACL role into the state store using the\n// provided write transaction. It is the responsibility of the caller to update\n// the index table.\nfunc (s *StateStore) upsertACLRoleTxn(\n\tindex uint64, txn *txn, role *structs.ACLRole, allowMissingPolicies bool) (bool, error) {\n\n\t// Ensure the role hash is not zero to provide defense in depth. This\n\t// should be done outside the state store, so we do not spend time here\n\t// and thus Raft, when it, can be avoided.\n\tif len(role.Hash) == 0 {\n\t\trole.SetHash()\n\t}\n","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store_acl.go#L57-L93","documentation":"After upserting ACL roles, updating the index table entry for acl_roles failed; the wrapped txn.Insert error marks the state update and aborts the commit.","triggerScenarios":"Thrown at nomad/state/state_store_acl.go:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the role upsert","Inspect server logs for index-table write errors","Verify Raft/state store health"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}