{"record":{"id":"fc21f4045689b7f0","repo":"hashicorp/nomad","slug":"index-update-failed-v-fc21f4","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_binding_rule.go","lineNumber":48,"sourceCode":"\tfor _, rule := range bindingRules {\n\n\t\tbindingRuleInserted, err := s.upsertACLBindingRuleTxn(index, txn, rule, allowMissingAuthMethod)\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 || bindingRuleInserted\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{TableACLBindingRules, index}); err != nil {\n\t\treturn fmt.Errorf(\"index update failed: %v\", err)\n\t}\n\n\treturn txn.Commit()\n}\n\n// upsertACLBindingRuleTxn inserts a single ACL binding rule into the state\n// store using the provided write transaction. It is the responsibility of the\n// caller to update the index table.\nfunc (s *StateStore) upsertACLBindingRuleTxn(\n\tindex uint64, txn *txn, rule *structs.ACLBindingRule, allowMissingAuthMethod bool) (bool, error) {\n\n\t// Ensure the rule 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 and\n\t// thus Raft, when it can be avoided.\n\tif len(rule.Hash) == 0 {\n\t\trule.SetHash()\n\t}\n","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store_acl_binding_rule.go#L30-L66","documentation":"Returned by UpsertACLBindingRules when inserting the new last-index entry for the acl_binding_rules table into the index table fails. This happens after all rules were written but before txn.Commit(), so the whole write aborts.","triggerScenarios":"txn.Insert(tableIndex, &IndexEntry{TableACLBindingRules, index}) erroring while applying an ACLBindingRulesUpsertRequest via Raft.","commonSituations":"Corrupted index table in the state store; memdb internal errors; version/schema skew.","solutions":["Inspect the wrapped error for the memdb root cause.","Retry the request; if it repeats, check server logs for state-store corruption.","Restore the cluster state from a snapshot."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := upsertBindingRules(rules)\nif err != nil && strings.Contains(err.Error(), \"index update failed\") {\n    retryWithBackoff(upsertBindingRules, rules)\n}","preventionTips":["Retry idempotent Raft writes","Keep cluster on one binary version","Restore from snapshot on persistent errors"],"tags":["nomad","state-store","acl","index"],"backgroundTag":"state-store-index-update-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"}