taverna-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stian Soiland-Reyes <st...@apache.org>
Subject Re: taverna exit code
Date Fri, 16 Sep 2016 08:44:50 GMT
(No need to cc support@mygrid, we're all no dev@taverna :)

The exit code from Taverna server reflects the exit code from
executeworkflow.sh - which would be 0 unless the workflow engine
itself failed. (e.g. the t2flow used a plugin that was not installed
on the server, or a file was not found)

The exit code of a individual tool within the workflow does not cause
the workflow to fail, but rather it will propagate "Error Documents"
on its outputs. Anything 'below' in the workflow expecting this value
will then in turn produce derived Error Documents. This means that if
the errror was within a list iteration, only that element of the list
(and subsequent iterations) are replaced with errors.

Similarly, the stdout and stderr of the individual tool (of which many
could be running concurrently) is captured by the workflow engine and
thus not shown in the stdout or stderr REST resources of the Server's
executeworkflow execution.

I just check the Tool Activity, and here it waits for the exit code:


You see it will provide the STDERR output as part of the exception
(which then goes into the error document).

It's configurable to allow certain exit codes, but this is not exposed
in the UI.

(Not so sure about that UnsupportedEncodingException handling there.. )

Perhaps valuable would be some kind of --fail-on-any-error option to
executeworkflow?  This could then be enabled in the server.  It could
bail out as soon as an error document appears at an output port.

On 15 September 2016 at 15:53, Simone Bnà <s.bn@cineca.it> wrote:
> Hi,
> I created a simple t2flow with an external tool that exits with a status code different
from 0, like below:
> #!/bin/bash
> set -e
> function mytest {
>     "$@"
>     local status=$?
>     if [ $status -ne 0 ]; then
>         echo "error with $1" >&2
>         exit $status
>     fi
> }
> mytest ssh `echo ${REMOTE_USER}@${COMPUTE_HOST}` " cd /folder_that_does_not_exist/;"
> echo 'finished'
> exit 0
> My code polls the taverna server (version 2.5.4) until the run finishes and then check
the exitcode (GET  https://host:port/taverna-server/rest/runs/UUID/listeners/io/properties/exitcode)
> What I found is that the exitcode of taverna is 0, different from the exit code of the
bash script.
> Is this a bug? Is there another way to get the right exit code?
> Best regards,
> Simone.
> --
> Simone Bnà, PhD
> C++ Software Developer, CINECA
> Via Magnanelli 6/3, 40033 Casalecchio di Reno, Italy
> office:   +39-0516171938
> email: s.bna@scsitaly.com/s.bn@cineca.it

Stian Soiland-Reyes

View raw message