hashicorp/nomad · error

ACL role deletion failed: %v

Error message

ACL role deletion failed: %v

What it means

Returned by deleteACLRoleByIDTxn when txn.Delete fails to remove an existing ACL role row from the acl_roles table. It wraps the underlying memdb delete error; the role was confirmed to exist just before.

Source

Thrown at nomad/state/state_store_acl.go:217

	return txn.Commit()
}

// deleteACLRoleByIDTxn deletes a single ACL role from the state store using the
// provided write transaction. It is the responsibility of the caller to update
// the index table.
func (s *StateStore) deleteACLRoleByIDTxn(txn *txn, roleID string) error {

	existing, err := txn.First(TableACLRoles, indexID, roleID)
	if err != nil {
		return fmt.Errorf("ACL role lookup failed: %v", err)
	}
	if existing == nil {
		return errors.New("ACL role not found")
	}

	// Delete the existing entry from the table.
	if err := txn.Delete(TableACLRoles, existing); err != nil {
		return fmt.Errorf("ACL role deletion failed: %v", err)
	}
	return nil
}

// GetACLRoles returns an iterator that contains all ACL roles stored within
// state.
func (s *StateStore) GetACLRoles(ws memdb.WatchSet) (memdb.ResultIterator, error) {
	txn := s.db.ReadTxn()

	// Walk the entire table to get all ACL roles.
	iter, err := txn.Get(TableACLRoles, indexID)
	if err != nil {
		return nil, fmt.Errorf("ACL role lookup failed: %v", err)
	}
	ws.Add(iter.WatchCh())

	return iter, nil
}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Inspect the wrapped error message for the memdb root cause.
  2. Verify state store integrity; restore from a Nomad snapshot if entries are corrupt.
  3. Ensure all server agents run the same Nomad version (rolling upgrades done correctly).
Defensive patterns

Strategy: retry

Validate before calling

role, err := client.ACLRoles().Get(roleID); if err != nil { return err }

Try / catch

if err := deleteRole(id); err != nil {
    if strings.Contains(err.Error(), "ACL role deletion failed") { retryWithBackoff(...) }
}

Prevention

When it happens

Trigger: memdb txn.Delete(TableACLRoles, existing) errors during DeleteACLRolesByID — typically an object not matching the table schema or an internal memdb failure.

Common situations: Corrupted state store entries (e.g. restored objects of wrong type); bugs after version migrations.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/2fa7b63ca2d96d7c. Report an issue: GitHub.