From 9ef9f34278d0be6f264557af8fec6082ba285b48 Mon Sep 17 00:00:00 2001 From: JeroenVerstraelen Date: Sun, 9 Jun 2024 09:03:39 +0200 Subject: [PATCH] use exc_info field for exc_info_with_locals in batch jobs --- openeogeotrellis/deploy/batch_job.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openeogeotrellis/deploy/batch_job.py b/openeogeotrellis/deploy/batch_job.py index 25caf055..443fd1c5 100644 --- a/openeogeotrellis/deploy/batch_job.py +++ b/openeogeotrellis/deploy/batch_job.py @@ -491,7 +491,9 @@ def _extract_and_install_udf_dependencies(process_graph: dict, job_dir: Path): error_summary = GeoPySparkBackendImplementation.summarize_exception_static(e) most_recent_exception = sys.exc_info()[1] fmt = Format(max_value_str_len=1000) - logger.exception("OpenEO batch job failed: " + error_summary.summary, extra = { - "exc_info_with_locals": format_exc(most_recent_exception, fmt = fmt) - }) + logger.exception("OpenEO batch job failed: " + error_summary.summary) + logger.error( + "Batch job error stack trace with locals", + extra={"exc_info": format_exc(most_recent_exception, fmt = fmt)} + ) raise