How to log all command outputs to the log file?

The job breaks with this error message: " AppInternalError: Please consult the job log; the job's reported error could not be parsed from the file job_error.json".   But when I look at the logs on the Monitor page, only the output of echo commands is captured there - none of the error logs or outputs of commands are saved there. How can I resolve this please? Thank you!      

Comments

5 comments

  • Comment author
    Ondrej Klempir DNAnexus Team

    You may want CLI approach rather and use "dx watch job-XXXX" that might have more information included in the log. In GUI, also make sure you show stdout as well as stderr.

     

    Screenshot 2023-11-28 at 16.04.15

    0
  • Comment author
    Former User of DNAx Community_10

    Hi, thanks for getting back to me. Sadly, this does not solve my problem. I have checked both approaches and with both, the only output that I can see is the echo statements - the output of other commands and errors does not seem to be logged.

     

    Here is an example of my code and what I see on both, the website Monitor page and when monitoring it via the commandline:imageimageimageimage

    0
  • Comment author
    Ondrej Klempir DNAnexus Team

    From the implementation snippet, it seems like the bash applet you run is yours and you have all control over it. If that is the case, you can try to add "set -euxo pipefail" on top of your main script and rebuild. See more details here: https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425

    0
  • Comment author
    Former User of DNAx Community_10

    Thanks for the suggestion but I don't see how that resolves my problem.. my issue is with error messages not being printed. The program exits as expected when it encounters and error and I can see from my email that the job has failed, but I have no way of seeing what the error is. Are there any recommended logging settings which should be included as part of the applet?

    0
  • Comment author
    Ondrej Klempir DNAnexus Team

    As I said, I think the "set -euxo pipefail" should do the trick. I might be wrong, but I would give it a chance.

    0

Please sign in to leave a comment.