From 131576f45074f277bac254df55920624cf8fdfaf Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Thu, 4 Aug 2022 17:30:30 +0200 Subject: [PATCH] always check output file existence --- lib/galaxy/jobs/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index 7d144126f821..04b23ad09a4f 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -1697,6 +1697,12 @@ def fail(message=job.info, exception=None): # Prior to fail we need to set job.state job.set_state(final_job_state) return fail(f"Job {job.id}'s output dataset(s) could not be read") + else: + # check existence of outputs (tools may delete outputs) + for dataset_path in self.get_output_fnames(): + if not os.path.exists(dataset_path.real_path): + job.set_state(final_job_state) + return fail(f"Job {job.id}'s output dataset(s) could not be read") job_context = ExpressionContext(dict(stdout=job.stdout, stderr=job.stderr)) if extended_metadata: