My snakemake pipeline asserts that my code raises a non-zero exit code whenever I run any rule, even though my code returns an error code of 0 if I manually run the same exact code, and it works perfectly normally when ran in Snakemake.
As per the advice of this question, I tried appending || true
to the shell command in the snakemake rule, changing my rule from looking like
rule rulename:
input:
"input/file"
output:
"output/file"
shell:
"python3.7 scripts/script.py {input} {output}"
to
rule rulename:
input:
"input/file"
output:
"output/file"
shell:
"python3.7 scripts/script.py {input} {output} || true"
However, when I re-run the pipeline, snakemake still errors and says, (exited with non-zero exit code)
, even though the || true
at the end will ensure that this command always returns an exit code of 0.
What is snakemake doing to cause that? For reference, I am using snakemake 5.5.0 with python 3.7.0, and the server I'm using has Ubuntu 16.04.5, if that's relevant.