From 4b81ee6418bddd41a184ff7b2ee8d689706ebaac Mon Sep 17 00:00:00 2001 From: Guilherme Gallo Date: Thu, 11 Apr 2024 18:52:30 -0300 Subject: [PATCH] ci/lava: Fix how exception entry in structured log Improves the error logging in the LAVA job submitter by capturing and logging the exception message rather than just the exception type when a job fails to run. Additionally, introduces a clearer script interruption message to aid in debugging and immediate understanding of job submission failures. Signed-off-by: Guilherme Gallo Part-of: --- .gitlab-ci/lava/lava_job_submitter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py index b120210e727..41dbec60538 100755 --- a/.gitlab-ci/lava/lava_job_submitter.py +++ b/.gitlab-ci/lava/lava_job_submitter.py @@ -498,8 +498,9 @@ class LAVAJobSubmitter(PathResolver): if not last_attempt_job: # No job was run, something bad happened STRUCTURAL_LOG["job_combined_status"] = "script_crash" - current_exception = str(sys.exc_info()[0]) + current_exception = str(sys.exc_info()[1]) STRUCTURAL_LOG["job_combined_fail_reason"] = current_exception + print(f"Interrupting the script. Reason: {current_exception}") raise SystemExit(1) STRUCTURAL_LOG["job_combined_status"] = last_attempt_job.status