NDAR / nda-tools

Python package for interacting with NDA web services. Used to validate, submit, and download data to and from NDA.
MIT License
48 stars 22 forks source link

downloadcmd <packageid> fails with "list index out of range" and exits without error code #25

Open yarikoptic opened 3 years ago

yarikoptic commented 3 years ago
$> downloadcmd 1478637
Running NDATools Version 0.2.3
Opening log: /home/yoh/NDAValidationResults/debug_log_20201112T133244.txt
list index out of range

$> echo $?
0

$> cat /home/yoh/NDAValidationResults/debug_log_20201112T133244.txt
2020-11-12 13:32:44,228:INFO:request to generate AWS token

so I guess somewhere it catches an exception and just prints it and happily exists. Should exit with non-0.

It also remains unclear what actually caused the exception and how to mitigate (most likely credentials - either minting a token; IIRC there were some recentish updates?)

NB package id in above oculd have been a wrong paste, but it behaves similarly with another, correct package id 1182919

yarikoptic commented 3 years ago

FWIW: after moving ~/.NDATools/settings.cfg aside

$> downloadcmd 1182919                                  
Running NDATools Version 0.2.3
Opening log: /home/yoh/NDAValidationResults/debug_log_20201112T134550.txt
Enter your NIMH Data Archives username:XXX
Enter your NIMH Data Archives password:
Enter your aws_access_key. If none, hit "Enter:"
Enter your aws_secret_key. If none, hit "Enter":
list index out of range

NB note slightly inconsistent prompting for the keys -- pushed fix to #21 (after rebasing)

yarikoptic commented 3 years ago

oh -- I guess -dp flag as expected to be specified. I will submit a PR to provide a bit more information but this issue of 0-exit is outstanding. Ideally interface should be redone etc, but that would be a bigger thing to do.