(Urgent) "DocType Authentication Log not found" when logging in after restart

Hey there,

Can please someone give me a hint what might have happened to my ERPNext install, based on the VM built in Dec 2016:
I wanted to update to the latest build but was getting mysql user access denied when I issued “bench update”.

What I did was a “bench restart” - for some reason I’m now getting this error message when I try to login to ERPNext:
DocType Authentication Log not found

This just started to appear after the restart.

Can anyone help pls?

Thanks,
Simon

I was thinking that a successful bench update might solve my issue here. Where is the issue with the mysql credentials?

`frappe@erpnext:~/frappe-bench$ sudo bench update
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

I can’t remember to change any passwords concerning databases.
This is how my site_config.json file looks like:

frappe@erpnext:~/frappe-bench/sites/erpnext.vm$ cat site_config.json { "db_name": "d56cb677eaab3383", "db_password": "SZ7Df4U8MaRId0p0", "encryption_key": "ebN1KUuHbtJctTQLJCLZUcvfgogHbJyD6sXbD3S8o6c=", "limits": { "space_usage": { "backup_size": 1.0, "database_size": 15.19, "files_size": 2.0, "total": 18.19 } }, "nginx_port": 80

Here is a full log of the server error:

frappe@erpnext:~/frappe-bench$ bench destroy-all-sessions Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module> main() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main click.Group(commands=commands)(prog_name='bench') File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func ret = f(frappe._dict(ctx.obj), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py", line 64, in destroy_all_sessions frappe.sessions.clear_all_sessions(reason) File "/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py", line 96, in clear_all_sessions delete_session(sid, reason=reason) File "/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py", line 87, in delete_session logout_feed(user, reason) File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/feed.py", line 64, in logout_feed add_authentication_log(subject, user, operation="Logout") File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/authentication_log/authentication_log.py", line 21, in add_authentication_log "operation": operation, File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 596, in get_doc return frappe.model.document.get_doc(arg1, arg2) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 50, in get_doc return controller(arg1, arg2) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 87, in __init__ self.init_valid_columns() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 225, in init_valid_columns for key in self.get_valid_columns(): File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 235, in get_valid_columns valid = self.meta.get_valid_columns() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 61, in meta self._meta = frappe.get_meta(self.doctype) File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 613, in get_meta return frappe.model.meta.get_meta(doctype, cached=cached) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py", line 30, in get_meta return frappe.cache().hget("meta", doctype, lambda: Meta(doctype)) File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 171, in hget value = generator() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py", line 30, in <lambda> return frappe.cache().hget("meta", doctype, lambda: Meta(doctype)) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py", line 65, in __init__ super(Meta, self).__init__("DocType", doctype) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 83, in __init__ self.load_from_db() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py", line 70, in load_from_db super(Meta, self).load_from_db() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 114, in load_from_db frappe.throw(_("{0} {1} not found").format(_(self.doctype), self.name), frappe.DoesNotExistError) File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 309, in throw msgprint(msg, raise_exception=exc, title=title, indicator='red') File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 302, in msgprint _raise_exception() File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 275, in _raise_exception raise raise_exception, encode(msg) frappe.exceptions.DoesNotExistError: DocType Authentication Log not found frappe@erpnext:~/frappe-bench$ bench destroy-all-sessions Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module> main() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main click.Group(commands=commands)(prog_name='bench') File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func ret = f(frappe._dict(ctx.obj), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py", line 64, in destroy_all_sessions frappe.sessions.clear_all_sessions(reason) File "/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py", line 96, in clear_all_sessions delete_session(sid, reason=reason) File "/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py", line 87, in delete_session logout_feed(user, reason) File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/feed.py", line 64, in logout_feed add_authentication_log(subject, user, operation="Logout") File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/authentication_log/authentication_log.py", line 21, in add_authentication_log "operation": operation, File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 596, in get_doc return frappe.model.document.get_doc(arg1, arg2) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 50, in get_doc return controller(arg1, arg2) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 87, in __init__ self.init_valid_columns() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 225, in init_valid_columns for key in self.get_valid_columns(): File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 235, in get_valid_columns valid = self.meta.get_valid_columns() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 61, in meta self._meta = frappe.get_meta(self.doctype) File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 613, in get_meta return frappe.model.meta.get_meta(doctype, cached=cached) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py", line 30, in get_meta return frappe.cache().hget("meta", doctype, lambda: Meta(doctype)) File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 171, in hget value = generator() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py", line 30, in <lambda> return frappe.cache().hget("meta", doctype, lambda: Meta(doctype)) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py", line 65, in __init__ super(Meta, self).__init__("DocType", doctype) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 83, in __init__ self.load_from_db() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py", line 70, in load_from_db super(Meta, self).load_from_db() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 114, in load_from_db frappe.throw(_("{0} {1} not found").format(_(self.doctype), self.name), frappe.DoesNotExistError) File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 309, in throw msgprint(msg, raise_exception=exc, title=title, indicator='red') File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 302, in msgprint _raise_exception() File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 275, in _raise_exception raise raise_exception, encode(msg) frappe.exceptions.DoesNotExistError: DocType Authentication Log not found frappe@erpnext:~/frappe-bench$

Try executing command without sudo

Hi,

I did that before, just tried sudo in this case because I don’t know how to help myself.

Does anyone have a clue what’s the issue? This kinda urgent, since it’s a productive system :-/

Simon

Hey Simon, I can bypass the login by simply ignoring the login boxes and clicking the login text above and to the right. It logs me in to the administrator account. I can’t log out after though but I can access everything fine it seems.
This happens after I did a backup and restore (which is not well documented by the way).
Hope this helps
kurt

I am no longer getting the error after I did bench update.
My mistakes were doing a backup but not getting the files as well as the database, and installing erpnext to a new VM on a new laptop without doing bench update which I had done on the old machine.
I finally found the bench --site [SITENAME] backup --with-files instructions somewhere halfway down a page, this gives you a database file whatever.sql.gz, public files files.tar and private files filesunderscoreprivate.tar.
After I had untarred the private files and public files from in the ~/frappe-bench/sites/ directory and bench --site sitename --force restore /path/to/sql I then did the bench update. All the issues have vanished.

Hi Kurt,

I discovered that workaround, too. Bad thing is, if people still have their cookie from last logins they end up with the (long) error message directly on their landingpage and there is no chance to get around w/o deleting the browser history (logins and cookies), because the Logout button doesn’t work either.

My issue wasn’t resolved with a bench update, neither did I restore a backup. I actually ran into this issue right after an update which failed half way due to mysql login problems (see error messages above).

I finally “solved” this by setting up a new VM and importing files and database backups into a vanilla machine. Lucklily that solved the issue and I was able to issue a bench update to the latest version w/o any more issues.

Rgds,
Simon