mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Read in stderr form galaxy.json
before checking whether stderr and exit code combination should result in a failed job. This should fix https://github.com/galaxyproject/galaxy/issues/5214.
This commit is contained in:
@@ -1178,13 +1178,22 @@ class JobWrapper(object, HasResourceParameters):
|
||||
# the tasks failed. So include the stderr, stdout, and exit code:
|
||||
return self.fail(job.info, stderr=stderr, stdout=stdout, exit_code=tool_exit_code)
|
||||
|
||||
# We collect the stderr from tools that write their stderr to galaxy.json
|
||||
legacy_tool_provided_metadata = self.get_tool_provided_job_metadata()
|
||||
extra_stderr = "\n".join([item.get('stderr') for item in legacy_tool_provided_metadata.tool_provided_job_metadata if item.get('stderr')])
|
||||
if extra_stderr:
|
||||
if stderr:
|
||||
stderr = "%s\n%s" % (stderr, extra_stderr)
|
||||
else:
|
||||
stderr = extra_stderr
|
||||
|
||||
# Check the tool's stdout, stderr, and exit code for errors, but only
|
||||
# if the job has not already been marked as having an error.
|
||||
# The job's stdout and stderr will be set accordingly.
|
||||
|
||||
# We set final_job_state to use for dataset management, but *don't* set
|
||||
# job.state until after dataset collection to prevent history issues
|
||||
if (self.check_tool_output(stdout, stderr, tool_exit_code, job)):
|
||||
if self.check_tool_output(stdout, stderr, tool_exit_code, job):
|
||||
final_job_state = job.states.OK
|
||||
else:
|
||||
final_job_state = job.states.ERROR
|
||||
|
||||
Reference in New Issue
Block a user