New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exception tracebacks in run:
blocks are sent to /dev/null, making rules hard to debug
#1698
Comments
Thanks for reporting this. I've also been bitten by this bug, and can confirm that it also affects v7.7. When I installed with |
The problem is the snakemake/snakemake/executors/__init__.py Line 469 in c8d81d0
in combination with the early return in snakemake/snakemake/logging.py Lines 433 to 435 in c8d81d0
This was introduced in c8d81d0#diff-438f3317205fd7130727d0589d2fc1a6c2e1f6fc48c2c04d354a8a09b91ba2f4 Last unaffected version is |
Am I missing something or would simply removing the early return fix this? |
I suffer the same issue, is there any hope for a fix? |
Still an issue on 7.12. |
Still an issue with 7.14.0 |
Hello, The regression is due to the commit: feat: new directive "retries" for annotating the number of times a job shall be restarted after a failure (#1649) If I revert the following in def get_job_args(self, job, **kwargs):
- return f"{super().get_job_args(job, **kwargs)} --quiet"
+ return f"{super().get_job_args(job, **kwargs)} --quiet all" I think that the "quiet" behavior has changed, and the executor subprocess does not have the correct command line option. IMO, the solution would be to correctly configure the "quiet" option in the subprocess. I agree with @dweindl |
Is there a way to transfer the error and trace back to a log file? One can do that by mounting a whole logging structure but this is probably too much for a simple run directive. Ideally, errors should go directly to a log if one is provided. |
All error printing and logging (both to standard output/error and snakemake's default log files) is already being done with a logging structure. The problem here is that the subprocess for the run block is being run with |
### Description Fix #1698 exception tracebacks in run: blocks are sent to /dev/null, making rules hard to debug <!--Add a description of your PR here--> ### QC <!-- Make sure that you can tick the boxes below. --> * [ ] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [x] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). I have created a text based on #1881 but I don't see how I can test that the error message is printed out correctly to a log.
The new version snakemake 7.15.1 fixes this issue. However now all the snakemake log from the executor is printed out. I wonder if there would be a better solution. |
In addition the log is printed to the stdout but not in the main snakemake logfile |
Can we reopen this issue? |
Snakemake version
7.8.1
Describe the bug
When calling python code in a
run:
block, an uncaught exception will cause the job to fail. As it should. However, the stack trace isn't captured so its not possible to track down the cause of the exception!Minimal example
The text was updated successfully, but these errors were encountered: