From a43082308d7f9028c33a25b9fafedb13042925ad Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 25 Sep 2025 15:04:40 -0700 Subject: [PATCH] actions: Log full exception from privileged daemon on error - This make it easy to find issues when looking at either main service logs or privileged daemon logs. Tests: - Raise an exception in one of the privileged actions. Notice that the exception is printed along with module name, action_name, stdout, stderr and traceback. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/actions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plinth/actions.py b/plinth/actions.py index 0634e3dd2..5762d3b99 100644 --- a/plinth/actions.py +++ b/plinth/actions.py @@ -503,6 +503,11 @@ def _privileged_call(module_name, action_name, arguments): return_value = {'result': 'success', 'return': return_values} except Exception as exception: return_value = get_return_value_from_exception(exception) + logger.exception( + 'Error running action: %s..%s(..): %s\nstdout:\n%s\nstderr:\n%s\n', + module_name, action_name, exception, + return_value['exception']['stdout'], + return_value['exception']['stderr']) return return_value