From ac9d2264ce2b019b80dd0867c73b9c80cd21d694 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Fri, 10 Nov 2017 14:26:04 +0100 Subject: [PATCH] Trigger the DbLogHandler for exceptions in WorkChains run by daemon Exceptions that are encountered when ticking processes only got logged to the daemon log but did not go through the logger of the process itself and therefore the exception message was not in any retrievable through the WorkCalculation node. In the tick_workflow_engine of the daemon, when an exception occurs in the ticking of the process, a log message is sent to the logger of the process which should have the DbLogHandler configured, which will cause the message to end up in the DbLog table. This message will then be accessible through for example 'verdi work report' --- aiida/work/daemon.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aiida/work/daemon.py b/aiida/work/daemon.py index 8384743bf5..bed804e1f5 100644 --- a/aiida/work/daemon.py +++ b/aiida/work/daemon.py @@ -49,6 +49,7 @@ def tick_workflow_engine(storage=None, print_exceptions=True): proc.stop() proc.run_until(ProcessState.DESTROYED) except BaseException: + proc.logger.error('exception occurred:\n{}'.format(traceback.format_exc())) if print_exceptions: traceback.print_exc() continue