From b4dd1b2cf2f5dc985fdbbc5d2e93a2e528958751 Mon Sep 17 00:00:00 2001 From: Omar Soriano Date: Fri, 15 Sep 2023 02:55:08 +0000 Subject: [PATCH] Update error logging In case of tarball extraction failures, log the exception and stack trace. These exceptions could cause the host to become stuck. The stack trace can help with debugging. --- deploy-agent/deployd/download/downloader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy-agent/deployd/download/downloader.py b/deploy-agent/deployd/download/downloader.py index 856ea780ca..8e2b51514c 100644 --- a/deploy-agent/deployd/download/downloader.py +++ b/deploy-agent/deployd/download/downloader.py @@ -121,13 +121,13 @@ def download(self): log.info("Successfully extracted {} to {}".format(local_full_fn, working_dir)) except tarfile.TarError as e: status = Status.FAILED - log.error("Failed to extract files: {}".format(e)) + log.exception("Failed to extract tar files") except OSError as e: status = Status.FAILED - log.error("Failed: {}".format(e)) + log.exception("Failed to extract files. OSError:") except Exception: status = Status.FAILED - log.error(traceback.format_exc()) + log.exception("Failed to extract files") finally: return status