Issue exiting Loris credentials prompt in Datalad after failed login

I am testing the use of Datalad to connect to Loris data resources, and in the case of an incorrectly entered password I am not finding a graceful way to exit the credentials prompt.

(testJan2025) eaobrien@datalad-dev:/data/temp-datasets/emmetaobrien$ datalad install https://github.com/CONP-PCNO/conp-dataset
[INFO   ] Remote origin not usable by git-annex; setting annex-ignore
[INFO   ] https://github.com/CONP-PCNO/conp-dataset/config download failed: Not Found
install(ok): /data/temp-datasets/emmetaobrien/conp-dataset (dataset)
(testJan2025) eaobrien@datalad-dev:/data/temp-datasets/emmetaobrien$ cd conp-dataset
(testJan2025) eaobrien@datalad-dev:/data/temp-datasets/emmetaobrien/conp-dataset$ datalad install projects/preventad-open
[INFO   ] Remote origin not usable by git-annex; setting annex-ignore
[INFO   ] https://github.com/conpdatasets/preventad-open/config download failed: Not Found
install(ok): /data/temp-datasets/emmetaobrien/conp-dataset/projects/preventad-open (dataset) [Installed subdataset in order to get /data/temp-datasets/emmetaobrien/conp-dataset/projects/preventad-open]
(testJan2025) eaobrien@datalad-dev:/data/temp-datasets/emmetaobrien/conp-dataset$ cd projects/preventad-open
(testJan2025) eaobrien@datalad-dev:/data/temp-datasets/emmetaobrien/conp-dataset/projects/preventad-open$ datalad get *
Total:   0%|                                                                            | 0.00/238G [00:00<?, ? Bytes/s]

You need to authenticate with 'loris-prevent-ad' credentials. https://openpreventad.loris.ca/api/v0.0.3-dev/login provides information on how to gain access
user: dummy

Please enter password for encrypted keyring:
You need to authenticate with 'loris-prevent-ad' credentials. https://openpreventad.loris.ca/api/v0.0.3-dev/login provides information on how to gain access
password:
You need to authenticate with 'loris-prevent-ad' credentials. https://openpreventad.loris.ca/api/v0.0.3-dev/login provides information on how to gain access
password (repeat):
You need to authenticate with 'loris-prevent-ad' credentials. https://openpreventad.loris.ca/api/v0.0.3-dev/login provides information on how to gain access
password:
You need to authenticate with 'loris-prevent-ad' credentials. https://openpreventad.loris.ca/api/v0.0.3-dev/login provides information on how to gain access
password (repeat):
Access to https://openpreventad.loris.ca/api/v0.0.3-dev/candidates/5448142/PREBL00/images has failed.
Do you want to enter other credentials in case they were updated? (choices: yes, no):

At this point, entering “no” asks the same question again, entering “yes” sends the user back into submitting username and password and returns to the same question after three failures, and neither Esc nor Ctrl-C exits the interface. Also, if the connection to the terminal window is broken by other means while the user is stuck at this point, e.g. by a session time-out, attempting to retry the download again hangs indefinitely at the point:

(testJan2025) eaobrien@datalad-dev:/data/temp-datasets/emmetaobrien/conp-dataset/projects/multicenter-phantom$ datalad get *
Total:   0%|                                                                           | 0.00/40.2G [00:00<?, ? Bytes/s]You need to authenticate with 'loris-phantom' credentials. https://phantom.loris.ca/api/v0.0.3-dev/login provides information on how to gain access
user:

without accepting any input, and looking at the processes for the user in question shows:

eaobrien    9268  0.0  0.2  17184  9820 ?        Ss   Jul14   0:00 /lib/systemd/systemd --user
eaobrien    9269  0.0  0.0 169620  3868 ?        S    Jul14   0:00 (sd-pam)
eaobrien   10324  0.0  0.0  12492  1832 ?        S    Jul14   0:00 /usr/lib/git-annex.linux/exe/git --library-path /usr/lib/git-annex.linux//lib/x86_64-linux-gnu: /usr/lib/git-annex.linux/shimmed/git/git -c diff.ignoreSubmodules=none -c core.quotepath=false annex get -c annex.retry=3 --json --json-error-messages --json-progress -c annex.dotfiles=true -- 964522 logo.png 435668 README.md 999876 833826 963271 698527 421863 397552 992086 623541 DATS.json
eaobrien   10339  1.4  1.4 1074208644 57236 ?    Sl   Jul14  26:27 /usr/lib/git-annex.linux/exe/git-annex --library-path /usr/lib/git-annex.linux//lib/x86_64-linux-gnu: /usr/lib/git-annex.linux/shimmed/git-annex/git-annex get -c annex.retry=3 --json --json-error-messages --json-progress -c annex.dotfiles=true -- 964522 logo.png 435668 README.md 999876 833826 963271 698527 421863 397552 992086 623541 DATS.json
eaobrien   10349  0.0  0.0      0     0 ?        Z    Jul14   0:00 [git] <defunct>
eaobrien   10350  0.0  0.0      0     0 ?        Z    Jul14   0:00 [git] <defunct>
eaobrien   10351  0.0  0.1  28568  7432 ?        S    Jul14   0:00 /usr/lib/git-annex.linux/exe/git --library-path /usr/lib/git-annex.linux//lib/x86_64-linux-gnu: /usr/lib/git-annex.linux/shimmed/git/git --git-dir=.git --work-tree=. --literal-pathspecs -c annex.retry=3 -c annex.dotfiles=true cat-file --batch=%(objectname) %(objecttype) %(objectsize) --buffer
eaobrien   10355  0.0  0.2  28568 10728 ?        S    Jul14   0:00 /usr/lib/git-annex.linux/exe/git --library-path /usr/lib/git-annex.linux//lib/x86_64-linux-gnu: /usr/lib/git-annex.linux/shimmed/git/git --git-dir=.git --work-tree=. --literal-pathspecs -c annex.retry=3 -c annex.dotfiles=true cat-file --batch=%(objectname) %(objecttype) %(objectsize) --buffer
eaobrien   10356  0.0  0.1  28568  6240 ?        S    Jul14   0:00 /usr/lib/git-annex.linux/exe/git --library-path /usr/lib/git-annex.linux//lib/x86_64-linux-gnu: /usr/lib/git-annex.linux/shimmed/git/git --git-dir=.git --work-tree=. --literal-pathspecs -c annex.retry=3 -c annex.dotfiles=true cat-file --batch
eaobrien   10379  0.0  0.1  10220  4672 ?        Ss   Jul14   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
eaobrien   10448  0.0  1.3 292472 53760 ?        S    Jul14   0:00 /usr/bin/python3 /home/eaobrien/.local/bin/git-annex-remote-datalad
eaobrien   15378  0.0  0.2  17252  8148 ?        S    09:39   0:00 sshd: eaobrien@pts/1
eaobrien   15380  0.0  0.1  13468  6236 pts/1    Ss   09:39   0:00 -bash
eaobrien   15447  0.0  0.2  17252  8056 ?        S    09:40   0:00 sshd: eaobrien@pts/2
eaobrien   15448  0.0  0.1  14588  6548 pts/2    Ss+  09:40   0:00 -bash
eaobrien   21469  0.0  0.1  14876  4556 pts/1    R+   16:23   0:00 ps -auxw
eaobrien   21470  0.0  0.0   9212  2304 pts/1    S+   16:23   0:00 grep --color=auto ^eaobrien

so is not at all a graceful failure mode.

Versions used are datalad 1.1.5, git annex version 10.20250102 on Ubuntu 22.04. I have had reports of the same failure happening on a Mac but do not have precise OS details to hand. This is particularly an issue as some of the Loris sites we serve require users to update passwords on a regular schedule so the likelihood of an attempted login failing with credentials the user has not realised are no longer valid seems high. Any advice as to how better to handle this would be much appreciated.


Emmet A. O’Brien
Data Specialist, Canadian Open Neuroscience Platform.