seq2science icon indicating copy to clipboard operation
seq2science copied to clipboard

BUG: Complete log file is incomplete

Open Rebecza opened this issue 4 years ago • 9 comments

Describe the bug The (more detailed) errors thrown by the pipeline are not documented in the complete log files generated at the end of the run.

I want to trace back what the cause of the errors was, in the complete logger produced at the end. For instance, the detailed description of the rule that fails or the detailed statements in the raised CalledProcessError exception, these can not be found back.

Screenshots An example of my error:

afbeelding

And this is the only information that can be found in the complete log seq2science.2021-04-22T120203.500592.log:

afbeelding

Rebecza avatar Apr 23 '21 10:04 Rebecza

Right, the snakemake logger can only pickup stderr OR stdout. We could redirect the stderr with contextlib, but also need to print it to the console.

siebrenf avatar Apr 23 '21 11:04 siebrenf

I am not entirely sure. But I think the piece of:

Error in rule XXX
......

piece is also missing? @Rebecza

Maarten-vd-Sande avatar Apr 23 '21 12:04 Maarten-vd-Sande

I think (not sure) this is related to the rule being executed in the run: directive... :thinking:

Maarten-vd-Sande avatar Apr 26 '21 11:04 Maarten-vd-Sande

That's it!

I can recreate logs missing Error in rule... by canceling this test run: seq2science run download-fastq --cores 2 --configfile tests/download_fastq/default_config.yaml

However, the following test run does have the Error in rule... when cancelled (or by placing an exit(1) in script get_genome.py): seq2science run alignment --cores 2 --configfile tests/alignment/remote_genome_n_sample.yaml --snakemakeOptions until=[get_genome_annotation]

The difference is the top one uses run:, the bottom uses script:.

siebrenf avatar May 03 '21 12:05 siebrenf

Ok that's annoying. :disappointed:

I don't think we can fix this at the moment. Perhaps if we upgrade the snakemake version in the future this gets solved? :shrug:

Maarten-vd-Sande avatar May 03 '21 12:05 Maarten-vd-Sande

Ok perhaps if we just capture all stdout and stderr, and redirect it to the s2s logfile, we have the best of both worlds? We capture everything, including the exceptions? :monocle_face: :thinking:

Maarten-vd-Sande avatar May 05 '21 11:05 Maarten-vd-Sande

I am not entirely sure. But I think the piece of:

Error in rule XXX
......

piece is also missing? @Rebecza

This probably comes to late: but yes, there is no printing of any "error"-containing-lines in the complete log, besides the very last: Exiting because a job execution failed. Look above for error message

Rebecza avatar May 06 '21 07:05 Rebecza

Ok I tried this in a test Snakefile. This is a snakemake bug unfortunately...

Maarten-vd-Sande avatar May 17 '21 12:05 Maarten-vd-Sande

Filed a report here: https://github.com/snakemake/snakemake/issues/1004

Maarten-vd-Sande avatar May 18 '21 10:05 Maarten-vd-Sande