{"record":{"id":"54c529032b3dc9d7","repo":"hashicorp/nomad","slug":"acl-binding-rule-deletion-failed-v","errorCode":null,"errorMessage":"ACL binding rule deletion failed: %v","messagePattern":"ACL binding rule deletion failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store_acl_binding_rule.go","lineNumber":158,"sourceCode":"\n\treturn txn.Commit()\n}\n\n// deleteACLBindingRuleTxn deletes a single ACL binding rule from 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) deleteACLBindingRuleTxn(txn *txn, ruleID string) error {\n\texisting, err := txn.First(TableACLBindingRules, indexID, ruleID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"ACL binding rule lookup failed: %v\", err)\n\t}\n\tif existing == nil {\n\t\treturn errors.New(\"ACL binding rule not found\")\n\t}\n\n\t// Delete the existing entry from the table.\n\tif err := txn.Delete(TableACLBindingRules, existing); err != nil {\n\t\treturn fmt.Errorf(\"ACL binding rule deletion failed: %v\", err)\n\t}\n\treturn nil\n}\n\n// GetACLBindingRules returns an iterator that contains all ACL binding rules\n// stored within state.\nfunc (s *StateStore) GetACLBindingRules(ws memdb.WatchSet) (memdb.ResultIterator, error) {\n\ttxn := s.db.ReadTxn()\n\n\t// Walk the entire table to get all ACL binding rules.\n\titer, err := txn.Get(TableACLBindingRules, indexID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ACL binding rules lookup failed: %v\", err)\n\t}\n\tws.Add(iter.WatchCh())\n\n\treturn iter, nil\n}","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store_acl_binding_rule.go#L140-L176","documentation":"This error means the ACL binding rule row was found but txn.Delete failed to remove it from the memdb table. Like the other wraps here, it signals an internal state store problem, since a successfully located row should always be deletable inside a write transaction.","triggerScenarios":"DeleteACLBindingRules finds the rule (deleteACLBindingRuleTxn passes the lookup and not-found checks) but txn.Delete(TableACLBindingRules, existing) returns an error, e.g. because the stored object no longer matches the table's index definitions (corrupted row).","commonSituations":"State store rows written by an incompatible Nomad version; corruption after unclean shutdown; restore snapshots taken from a mismatched version.","solutions":["Restore the state store from a known-good snapshot taken with the current Nomad version.","Verify all servers run the same Nomad version; rolling-upgrade mismatches can leave rows with stale index schemas.","Retry the delete after a leader change if it coincided with failover.","Report with the wrapped error if reproducible — deletion of an existing row should not fail."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if _, err := state.GetACLBindingRule(nil, ruleID); err != nil {\n    return err\n} // rule existence already verified before this delete runs","typeGuard":null,"tryCatchPattern":"if err := deleteBindingRules(ids); err != nil {\n    if strings.Contains(err.Error(), \"deletion failed\") {\n        // likely corrupted row; plan snapshot restore\n        log.Error(\"binding rule delete failed\", \"cause\", err)\n        return err\n    }\n    return err\n}","preventionTips":["Take regular nomad snapshot backups for recovery from corrupted rows.","Avoid downgrading servers below the version that wrote the rows.","Verify cluster health after unclean shutdowns before ACL writes.","Escalate reproducible cases with the wrapped error text."],"tags":["nomad","state-store","acl","delete"],"backgroundTag":"state-store-transaction-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"}