Skip to content
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

Printing the command being run when encountering an error. #32

Closed
DongzeHE opened this issue Dec 23, 2022 · 4 comments
Closed

Printing the command being run when encountering an error. #32

DongzeHE opened this issue Dec 23, 2022 · 4 comments

Comments

@DongzeHE
Copy link
Collaborator

One suggestion: when running simpleaf, if we encounter an error, can we print the command being run? I had some path issues when running simpleaf quant. It just told me that mapping failed. To debug it, I had to go to quant_info.json and find the mapping command and remove all quotes between arguments and run the salmon alevin command.

@rob-p
Copy link
Contributor

rob-p commented Dec 23, 2022

The log /should does print the command being run. For example, I recently had one terminate with:

[2022-12-23T02:27:02Z INFO  simpleaf] cmd : "alevin-fry" "quant" "-i" "data/af_quant" "-o" "data/af_quant" "-t" "24" "-m" "t2g_3col.tsv" "-r" "cr-like"
Error: quant failed with exit status ExitStatus(unix_wait_status(512))

The problem is --- WTH is unix_wait_status(512)? It turns out the path to the t2g_3col.tsv was wrong. I think some of that can be avoided by better input and output validation between steps (e.g. check all provided input files exist, and when step i executes, ensure that all expected files for step i+1 exist when it finishes (and print an informative message otherwise).

@DongzeHE
Copy link
Collaborator Author

Right, I also got weird error messages like this. Is there a way to copy and paste the error message returned by salmon and alevin-fry when quitting with errors?

@rob-p
Copy link
Contributor

rob-p commented Dec 23, 2022

It depends how they report the error, they may not report a message. The standard way to do this would be to capture the standard error buffer and dump that as well. However, these errors (e.g. wait status 512) are usually due to missing files. From that perspective, I think defensive checks for files being where the user expected they were would cover like 80% of the problems.

@rob-p
Copy link
Contributor

rob-p commented Jan 6, 2023

Basic input file checking has been implemented as of 034d531. It can still be improved (e.g. to make sure that things expected to be files are files and things expected to be directories are directories). Also, we can (if we choose) explicitly check for the expected files inside of directory arguments. However, I'll consider what we currently have to be a decent solution, or at least the start of one.

@rob-p rob-p closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants