I have created a ledger doctype and make it as a child table of the User. but later I deleted the ledgers table from that point onwards I cannot enter into the frappe desk
and it is showing this error
Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 98, in application
init_request(request)
File “apps/frappe/frappe/app.py”, line 198, in init_request
frappe.local.http_request = HTTPRequest()
File “apps/frappe/frappe/auth.py”, line 42, in init
self.set_session()
File “apps/frappe/frappe/auth.py”, line 76, in set_session
frappe.local.login_manager = LoginManager()
File “apps/frappe/frappe/auth.py”, line 134, in init
self.make_session(resume=True)
File “apps/frappe/frappe/auth.py”, line 224, in make_session
frappe.local.session_obj = Session(
File “apps/frappe/frappe/sessions.py”, line 220, in init
self.resume()
File “apps/frappe/frappe/sessions.py”, line 304, in resume
self.validate_user()
File “apps/frappe/frappe/sessions.py”, line 228, in validate_user
if not frappe.get_cached_value(“User”, self.user, “enabled”):
File “apps/frappe/frappe/init.py”, line 1214, in get_cached_value
doc = get_cached_doc(doctype, name)
File “apps/frappe/frappe/init.py”, line 1155, in get_cached_doc
doc = get_doc(*args, **kwargs)
File “apps/frappe/frappe/init.py”, line 1283, in get_doc
return frappe.model.document.get_doc(*args, **kwargs)
File “apps/frappe/frappe/model/utils/init.py”, line 215, in wrapper
return dispatch(args[0])(*args, **kw)
File “apps/frappe/frappe/model/document.py”, line 90, in get_doc_str
return controller(doctype, name, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 174, in init
self._init_dispatch(args[0], *args[1:], **kwargs)
File “/usr/lib/python3.10/functools.py”, line 926, in _method
return method.get(obj, cls)(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 204, in _init_str
self._init_known_doc(doctype, name, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 192, in _init_known_doc
self.load_from_db()
File “apps/frappe/frappe/model/document.py”, line 263, in load_from_db
self.load_children_from_db()
File “apps/frappe/frappe/model/document.py”, line 293, in load_children_from_db
children = frappe.db.sql(
File “apps/frappe/frappe/database/database.py”, line 238, in sql
self._cursor.execute(query, values)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 153, in execute
result = self._query(query)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 322, in _query
conn.query(q)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 563, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 825, in _read_query_result
result.read()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 1199, in read
first_packet = self.connection._read_packet()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_packet
packet.raise_for_error()
File “env/lib/python3.10/site-packages/pymysql/protocol.py”, line 219, in raise_for_error
err.raise_mysql_exception(self._data)
File “env/lib/python3.10/site-packages/pymysql/err.py”, line 150, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, “Table ‘_187a2db19fc9245e.tabledgers’ doesn’t exist”)
But I checked the User doctype through frappe bench and in it there is’nt any reference in the user doctype
Below is the User doctype attributes after using the command describe tabUser
MariaDB [_187a2db19fc9245e]> describe tabUser;
±----------------------------------------±-------------±-----±----±------------±------+
| Field | Type | Null | Key | Default | Extra |
±----------------------------------------±-------------±-----±----±------------±------+
| name | varchar(140) | NO | PRI | NULL | |
| creation | datetime(6) | YES | MUL | NULL | |
| modified | datetime(6) | YES | | NULL | |
| modified_by | varchar(140) | YES | | NULL | |
| owner | varchar(140) | YES | | NULL | |
| docstatus | tinyint(4) | NO | | 0 | |
| idx | int(11) | NO | | 0 | |
| enabled | tinyint(4) | NO | | 1 | |
| email | varchar(140) | YES | | NULL | |
| first_name | varchar(140) | YES | | NULL | |
| middle_name | varchar(140) | YES | | NULL | |
| last_name | varchar(140) | YES | | NULL | |
| full_name | varchar(140) | YES | | NULL | |
| username | varchar(140) | YES | UNI | NULL | |
| language | varchar(140) | YES | | NULL | |
| time_zone | varchar(140) | YES | | NULL | |
| send_welcome_email | tinyint(4) | NO | | 1 | |
| unsubscribed | tinyint(4) | NO | | 0 | |
| user_image | text | YES | | NULL | |
| role_profile_name | varchar(140) | YES | | NULL | |
| module_profile | varchar(140) | YES | | NULL | |
| home_settings | longtext | YES | | NULL | |
| gender | varchar(140) | YES | | NULL | |
| birth_date | date | YES | | NULL | |
| interest | text | YES | | NULL | |
| phone | varchar(140) | YES | | NULL | |
| location | varchar(140) | YES | | NULL | |
| bio | text | YES | | NULL | |
| mobile_no | varchar(140) | YES | UNI | NULL | |
| mute_sounds | tinyint(4) | NO | | 0 | |
| desk_theme | varchar(140) | YES | | NULL | |
| code_editor_type | varchar(140) | YES | | vscode | |
| banner_image | text | YES | | NULL | |
| search_bar | tinyint(4) | NO | | 1 | |
| notifications | tinyint(4) | NO | | 1 | |
| list_sidebar | tinyint(4) | NO | | 1 | |
| bulk_actions | tinyint(4) | NO | | 1 | |
| view_switcher | tinyint(4) | NO | | 1 | |
| form_sidebar | tinyint(4) | NO | | 1 | |
| timeline | tinyint(4) | NO | | 1 | |
| dashboard | tinyint(4) | NO | | 1 | |
| new_password | text | YES | | NULL | |
| logout_all_sessions | tinyint(4) | NO | | 1 | |
| reset_password_key | varchar(140) | YES | | NULL | |
| last_reset_password_key_generated_on | datetime(6) | YES | | NULL | |
| last_password_reset_date | date | YES | | NULL | |
| redirect_url | text | YES | | NULL | |
| document_follow_notify | tinyint(4) | NO | | 0 | |
| document_follow_frequency | varchar(140) | YES | | Daily | |
| follow_created_documents | tinyint(4) | NO | | 0 | |
| follow_commented_documents | tinyint(4) | NO | | 0 | |
| follow_liked_documents | tinyint(4) | NO | | 0 | |
| follow_assigned_documents | tinyint(4) | NO | | 0 | |
| follow_shared_documents | tinyint(4) | NO | | 0 | |
| email_signature | longtext | YES | | NULL | |
| thread_notify | tinyint(4) | NO | | 1 | |
| send_me_a_copy | tinyint(4) | NO | | 0 | |
| allowed_in_mentions | tinyint(4) | NO | | 1 | |
| default_workspace | varchar(140) | YES | | NULL | |
| default_app | varchar(140) | YES | | NULL | |
| simultaneous_sessions | int(11) | NO | | 2 | |
| restrict_ip | text | YES | | NULL | |
| last_ip | varchar(140) | YES | | NULL | |
| login_after | int(11) | NO | | 0 | |
| user_type | varchar(140) | YES | | System User | |
| last_active | datetime(6) | YES | | NULL | |
| login_before | int(11) | NO | | 0 | |
| bypass_restrict_ip_check_if_2fa_enabled | tinyint(4) | NO | | 0 | |
| last_login | varchar(140) | YES | | NULL | |
| last_known_versions | text | YES | | NULL | |
| api_key | varchar(140) | YES | UNI | NULL | |
| api_secret | text | YES | | NULL | |
| onboarding_status | text | YES | | ‘{}’ | |
| _user_tags | text | YES | | NULL | |
| _comments | text | YES | | NULL | |
| _assign | text | YES | | NULL | |
| _liked_by | text | YES | | NULL | |
±----------------------------------------±-------------±-----±----±------------±------+
77 rows in set (0.009 sec)
what might be the error here and how to solve this ?