How to see stdout even when tool is successful
Hello, I'm writing some wrappers for Galaxy and am finding it difficult to debug proper redirection of stderr and stdout in my wrapper subprocesses. When Galaxy detects an error running a tool, it highlights the output files in red and gives you the "bug" icon so that you can view stderr and stdout. However, when Galaxy interprets the tool as having run successfully, I'm unable to find a way to view what was in stdout. Long story short, Galaxy is interpreting my tool to have run successfully even when it hasn't. I'm redirecting stderr to sdtout on my <command> line in the tool conf file so that Galaxy only relies on return codes to detect an error in the tool, not stderr. Is there a way to view stdout when a tool has run "successfully"? Cheers -- Branden Timm Great Lakes Bioenergy Research Center btimm@glbrc.wisc.edu
Branden, The current Galaxy job runner does not respect the tool unix exit flag unfortunately and will assume an error if the tool writes anything to stderr - there's a ticket on this but no progress at http://bitbucket.org/galaxy/galaxy-central/issue/325/allow-tool-authors-to-d... - writing to stdout should (AFAIK) not cause the job to error out? Escaping redirection on the command line param is a pain, but you could (eg) use something based on the shell code in tools/bigbedwig/discard_stderr_wrapper.sh written by Assaf Gordon - see below? [rerla@beast galaxy]$ cat tools/bigbedwig/discard_stderr_wrapper.sh #!/bin/sh # STDERR wrapper - discards STDERR if command execution was OK. # # This script executes a given command line, # while saving the STDERR in a temporary file. # # When the command is completed, it checks to see if the exit code was zero. # if so - the command is assumed to have succeeded - the STDERR file is discarded. # if not - the command is assumed to have failed, and the STDERR file is dumped to the real STDERR # # # Use this wrapper for tools which insist on writting stuff to STDERR even if they succeeded - # which throws galaxy off balance. # # # Copyright 2009 (C) by Assaf Gordon # This file is distributed under the BSD license. TMPFILE=$(mktemp) || exit 1 "$@" 2> $TMPFILE EXITCODE=$? # Exitcode != 0 ? if [ "$EXITCODE" -ne "0" ]; then cat $TMPFILE >&2 fi rm $TMPFILE exit $EXITCODE On Fri, Sep 3, 2010 at 12:53 PM, Branden Timm <btimm@wisc.edu> wrote:
Hello, I'm writing some wrappers for Galaxy and am finding it difficult to debug proper redirection of stderr and stdout in my wrapper subprocesses. When Galaxy detects an error running a tool, it highlights the output files in red and gives you the "bug" icon so that you can view stderr and stdout. However, when Galaxy interprets the tool as having run successfully, I'm unable to find a way to view what was in stdout.
Long story short, Galaxy is interpreting my tool to have run successfully even when it hasn't. I'm redirecting stderr to sdtout on my <command> line in the tool conf file so that Galaxy only relies on return codes to detect an error in the tool, not stderr.
Is there a way to view stdout when a tool has run "successfully"?
Cheers
-- Branden Timm Great Lakes Bioenergy Research Center btimm@glbrc.wisc.edu _______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
-- Ross Lazarus MBBS MPH Associate Professor, Harvard Medical School Director of Bioinformatics, Channing Laboratory 181 Longwood Ave., Boston MA 02115, USA. Tel: +1 617 505 4850
Ross, thank you for the suggestion I will look into that. I didn't know that Galaxy only determines success/failure based on output to STDERR. I'd still like to know how I can see the entire stdout output, even when a tool runs successfully (at least, as far as Galaxy isc concerned). Thanks! -- Branden Timm Great Lakes Bioenergy Research Center btimm@glbrc.wisc.edu Ross wrote:
Branden,
The current Galaxy job runner does not respect the tool unix exit flag unfortunately and will assume an error if the tool writes anything to stderr - there's a ticket on this but no progress at http://bitbucket.org/galaxy/galaxy-central/issue/325/allow-tool-authors-to-d... - writing to stdout should (AFAIK) not cause the job to error out?
Escaping redirection on the command line param is a pain, but you could (eg) use something based on the shell code in tools/bigbedwig/discard_stderr_wrapper.sh written by Assaf Gordon - see below?
[rerla@beast galaxy]$ cat tools/bigbedwig/discard_stderr_wrapper.sh #!/bin/sh
# STDERR wrapper - discards STDERR if command execution was OK.
# # This script executes a given command line, # while saving the STDERR in a temporary file. # # When the command is completed, it checks to see if the exit code was zero. # if so - the command is assumed to have succeeded - the STDERR file is discarded. # if not - the command is assumed to have failed, and the STDERR file is dumped to the real STDERR # # # Use this wrapper for tools which insist on writting stuff to STDERR even if they succeeded - # which throws galaxy off balance. # # # Copyright 2009 (C) by Assaf Gordon # This file is distributed under the BSD license.
TMPFILE=$(mktemp) || exit 1
"$@" 2> $TMPFILE
EXITCODE=$? # Exitcode != 0 ? if [ "$EXITCODE" -ne "0" ]; then cat $TMPFILE >&2 fi rm $TMPFILE
exit $EXITCODE
On Fri, Sep 3, 2010 at 12:53 PM, Branden Timm <btimm@wisc.edu> wrote:
Hello, I'm writing some wrappers for Galaxy and am finding it difficult to debug proper redirection of stderr and stdout in my wrapper subprocesses. When Galaxy detects an error running a tool, it highlights the output files in red and gives you the "bug" icon so that you can view stderr and stdout. However, when Galaxy interprets the tool as having run successfully, I'm unable to find a way to view what was in stdout.
Long story short, Galaxy is interpreting my tool to have run successfully even when it hasn't. I'm redirecting stderr to sdtout on my <command> line in the tool conf file so that Galaxy only relies on return codes to detect an error in the tool, not stderr.
Is there a way to view stdout when a tool has run "successfully"?
Cheers
-- Branden Timm Great Lakes Bioenergy Research Center btimm@glbrc.wisc.edu _______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
participants (2)
-
Branden Timm
-
Ross