diff --git a/jobrunner/main.py b/jobrunner/main.py index 24d5cc8..2d85c1b 100755 --- a/jobrunner/main.py +++ b/jobrunner/main.py @@ -799,7 +799,13 @@ def extendMailOrNotifyCmdLockRequired( safeWrite(tmp, depJob.detail(False)) safeWrite(tmp, "\n" + SPACER_EACH + "\n") assert depJob.logfile - lines = autoDecode(check_output(["tail", "-n20", depJob.logfile])) + out = check_output(["tail", "-n20", depJob.logfile]) + try: + lines = autoDecode(out) + except ValueError as err: + LOG.debug("error decoding output from log file %r for %s: %s", + depJob.logfile, depJob, err) + lines = f"{out[:50]}\n" safeWrite(tmp, lines) safeWrite(tmp, SPACER_EACH + "\n") safeWrite(tmp, "\n") diff --git a/jobrunner/utils.py b/jobrunner/utils.py index 75c615e..e7f3738 100644 --- a/jobrunner/utils.py +++ b/jobrunner/utils.py @@ -348,7 +348,7 @@ def sudoKillProcGroup(pgrp): try: subprocess.check_call(cmd) except subprocess.CalledProcessError as error: - LOG("cmd %r => error=%s", cmd, error, exc_info=True) + LOG.debug("cmd %r => error=%s", cmd, error, exc_info=True) return error.output return None