Checking the error output of ignored tasks

It shouldn’t surprise you that when you set the errorStrategy directive to ignore in some processes, and they fail, their failure will be… ignored :laughing:. But what if you want to check what the error messages were? One way is to get the task dir path of every task of theses processes and then check the .command.err file of each one of them. A bit of a pain, right? :sweat_smile:

With the following command line, though, it’s much easier:

nextflow log last -f hash,workdir,stderr -F 'exit != 0'

If you want to see this in action, create a file named err.nf with the following content:

process FOO {
  errorStrategy 'ignore'

  output:
  stdout

  script:
  """
  asdhaha
  """
}

process BAR {
  errorStrategy 'ignore'

  output:
  stdout

  script:
  """
  stat file_that_does_not_exist
  """
}

workflow {
  FOO()
  BAR()
}

If you run the script above with nextflow run err.nf, you should get as output something like the picture below:

But if you run our magical command line, you should see something like:

As you can see, you can easily see at the right side of the output, the error messages of all tasks, of every process, including those with the error strategy set to ignore :wink:.

See also this swanky new feature:

1 Like

Oh, cool! Looking forward to seeing it merged :partying_face:

It may not be obvious at first, but very large pipelines can have tasks silently failing with ignore, making the user believe everything went alright. The user asked it this way, but still :sweat_smile:

The ignoreThenFail new error strategy makes sure it doesn’t go silently! :star_struck: