diff --git a/lib/galaxy/job_execution/actions/post.py b/lib/galaxy/job_execution/actions/post.py index 408ea2accb6c..01532624114c 100644 --- a/lib/galaxy/job_execution/actions/post.py +++ b/lib/galaxy/job_execution/actions/post.py @@ -9,10 +9,7 @@ from galaxy.model import PostJobActionAssociation from galaxy.model.base import transaction -from galaxy.util import ( - send_mail, - unicodify, -) +from galaxy.util import send_mail from galaxy.util.custom_logging import get_logger log = get_logger(__name__) @@ -70,8 +67,8 @@ def execute(cls, app, sa_session, action, job, replacement_dict, final_job_state if link_invocation: body += f"\n\nWorkflow Invocation Report:\n{link_invocation}" send_mail(app.config.email_from, to, subject, body, app.config) - except Exception as e: - log.error("EmailAction PJA Failed, exception: %s", unicodify(e)) + except Exception: + log.exception("EmailAction PJA Failed") @classmethod def get_short_str(cls, pja): diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index 04d4c57e4c76..7822f226feaa 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -1420,8 +1420,8 @@ def fail( try: shutil.move(dataset_path.false_path, dataset_path.real_path) log.debug("fail(): Moved %s to %s", dataset_path.false_path, dataset_path.real_path) - except OSError as e: - log.error("fail(): Missing output file in working directory: %s", unicodify(e)) + except FileNotFoundError as e: + log.warning("fail(): Missing output file in working directory: %s", unicodify(e)) except Exception as e: log.exception(str(e)) for dataset_assoc in job.output_datasets + job.output_library_datasets: diff --git a/lib/galaxy/jobs/runners/slurm.py b/lib/galaxy/jobs/runners/slurm.py index 2c0ab4af6b59..98c373d96645 100644 --- a/lib/galaxy/jobs/runners/slurm.py +++ b/lib/galaxy/jobs/runners/slurm.py @@ -222,6 +222,9 @@ def __check_memory_limit(self, efile_path): return OUT_OF_MEMORY_MSG elif any(_ in stripped_line for _ in SLURM_MEMORY_LIMIT_EXCEEDED_PARTIAL_WARNINGS): return PROBABLY_OUT_OF_MEMORY_MSG + except FileNotFoundError: + # Entirely expected, as __check_memory_limit is only called if the job state is CANCELLED + return False except Exception: log.exception("Error reading end of %s:", efile_path)