From ffc6e5e0fa6ab06167513cefa8f111a2ea7bdd3e Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 15 May 2023 10:23:27 -0500 Subject: [PATCH 1/2] Usage that is compatible with Python 3.8 and 3.11 > Since Python 3.10, instead of passing value and tb, an exception object can be passed as the first argument. If value and tb are provided, the first argument is ignored in order to provide backwards compatibility. > > -- https://docs.python.org/3/library/traceback.html --- synapse/app/_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/app/_base.py b/synapse/app/_base.py index 4dfcf484faf3..936b1b043037 100644 --- a/synapse/app/_base.py +++ b/synapse/app/_base.py @@ -214,7 +214,7 @@ def handle_startup_exception(e: Exception) -> NoReturn: # the reactor are written to the logs, followed by a summary to stderr. logger.exception("Exception during startup") - error_string = "".join(traceback.format_exception(e)) + error_string = "".join(traceback.format_exception(type(e), e, e.__traceback__)) indented_error_string = indent(error_string, " ") quit_with_error( From c7a89faf1b1a7d31a6a4d20ba1a63b7a459a2e1c Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 15 May 2023 14:47:30 -0500 Subject: [PATCH 2/2] Add changelog --- changelog.d/15599.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/15599.bugfix diff --git a/changelog.d/15599.bugfix b/changelog.d/15599.bugfix new file mode 100644 index 000000000000..b58af8ad5513 --- /dev/null +++ b/changelog.d/15599.bugfix @@ -0,0 +1 @@ +Print full error and stack-trace of any exception that occurs during startup/initialization.