ERPNext showing a random mysql operational error because of my users. Cant logout

I set up a fresh install of ERPNext with typical master data. However, once I started to create different users with different roles and modules allowed, my ERPNext started break by not allowing me to logout or generating a MySQL operational error. I cannot repeat the alert as it appears randomly. However, I can repeat another error by trying to save my users and when i do try to save it shows “tenacity.RetryError: RetryError[]”. I attached the image of the error and the error stack below. Can any help me out here? I managed to narrow down the error to only the users as I am able to save in order documents.

Thank you!
unknown

### App Versions

{
“erpnext”: “14.1.2”,
“frappe”: “14.8.0”,
“payments”: “0.0.1”
}

### Route

Workspaces/Home

### Trackeback

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 55, in application
init_request(request)
File “apps/frappe/frappe/app.py”, line 132, in init_request
frappe.local.http_request = frappe.auth.HTTPRequest()
File “apps/frappe/frappe/auth.py”, line 34, in init
self.set_session()
File “apps/frappe/frappe/auth.py”, line 68, in set_session
frappe.local.login_manager = LoginManager()
File “apps/frappe/frappe/auth.py”, line 117, in init
self.make_session(resume=True)
File “apps/frappe/frappe/auth.py”, line 205, in make_session
frappe.local.session_obj = Session(
File “apps/frappe/frappe/sessions.py”, line 238, in init
self.resume()
File “apps/frappe/frappe/sessions.py”, line 310, in resume
validate_ip_address(self.user)
File “apps/frappe/frappe/auth.py”, line 413, in validate_ip_address
frappe.get_cached_value(“User”, user, user_fields, as_dict=True)
File “apps/frappe/frappe/init.py”, line 1155, in get_cached_value
doc = get_cached_doc(doctype, name, _allow_dict=True)
File “apps/frappe/frappe/init.py”, line 1100, in get_cached_doc
doc = get_doc(*args, **kwargs)
File “apps/frappe/frappe/init.py”, line 1189, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 74, in get_doc
return controller(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 106, in init
self.load_from_db()
File “apps/frappe/frappe/model/document.py”, line 132, in load_from_db
if not getattr(self, “_metaclass”, False) and self.meta.issingle:
File “apps/frappe/frappe/model/base_document.py”, line 118, in meta
self._meta = meta = frappe.get_meta(self.doctype)
File “apps/frappe/frappe/init.py”, line 1220, in get_meta
return frappe.model.meta.get_meta(doctype, cached=cached)
File “apps/frappe/frappe/model/meta.py”, line 51, in get_meta
meta = Meta(doctype)
File “apps/frappe/frappe/model/meta.py”, line 114, in init
self.process()
File “apps/frappe/frappe/model/meta.py”, line 135, in process
self.set_custom_permissions()
File “apps/frappe/frappe/model/meta.py”, line 498, in set_custom_permissions
custom_perms = frappe.get_all(
File “apps/frappe/frappe/init.py”, line 1915, in get_all
return get_list(doctype, *args, **kwargs)
File “apps/frappe/frappe/init.py”, line 1887, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
File “apps/frappe/frappe/model/db_query.py”, line 172, in execute
result = self.build_and_run()
File “apps/frappe/frappe/model/db_query.py”, line 187, in build_and_run
args = self.prepare_args()
File “apps/frappe/frappe/model/db_query.py”, line 226, in prepare_args
self.build_conditions()
File “apps/frappe/frappe/model/db_query.py”, line 523, in build_conditions
self.build_filter_conditions(self.filters, self.conditions)
File “apps/frappe/frappe/model/db_query.py”, line 544, in build_filter_conditions
conditions.append(self.prepare_filter_condition(f))
File “apps/frappe/frappe/model/db_query.py”, line 556, in prepare_filter_condition
f = get_filter(self.doctype, f, additional_filters_config)
File “apps/frappe/frappe/utils/data.py”, line 1779, in get_filter
df = frappe.get_meta(f.doctype).get_field(f.fieldname)
File “apps/frappe/frappe/init.py”, line 1220, in get_meta
return frappe.model.meta.get_meta(doctype, cached=cached)
File “apps/frappe/frappe/model/meta.py”, line 51, in get_meta
meta = Meta(doctype)
File “apps/frappe/frappe/model/meta.py”, line 113, in init
super().init(“DocType”, doctype)
File “apps/frappe/frappe/model/document.py”, line 106, in init
self.load_from_db()
File “apps/frappe/frappe/model/meta.py”, line 118, in load_from_db
super().load_from_db()
File “apps/frappe/frappe/model/document.py”, line 163, in load_from_db
frappe.db.get_values(
File “apps/frappe/frappe/database/database.py”, line 570, in get_values
out = self._get_values_from_table(
File “apps/frappe/frappe/database/database.py”, line 800, in _get_values_from_table
return self.sql(query, as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck)
File “apps/frappe/frappe/database/database.py”, line 207, in sql
self._cursor.execute(query, values)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_query_result
result.read()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 1156, in read
first_packet = self.connection._read_packet()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1052, “Column ‘parent’ in where clause is ambiguous”)

### Request Data

{
“type”: “POST”,
“args”: {},
“headers”: {},
“error_handlers”: {},
“url”: “/api/method/erpnext.support.doctype.service_level_agreement.service_level_agreement.get_sla_doctypes”
}

### Response Data

{
“exception”: “pymysql.err.OperationalError: (1052, "Column ‘parent’ in where clause is ambiguous")”
}