Closed mslw closed 13 hours ago
@mslw Thanks for catching that and the great writeup. I look into it. Did you check what happens if the allowed-url-schemes include datalad-remake
?
@mslw Thanks for catching that and the great writeup. I look into it. Did you check what happens if the allowed-url-schemes include
datalad-remake
?
I just checked, it won't work - still goes through the web special remote, the error message changes to "download failed: Unsupported url scheme datalad-remake:///?label=one-to-many(...)"
The man page section for the option contains this: "Some special remotes support their own domain-specific URL schemes; those are not affected by this configuration setting"
Might also be worth comparing to e.g. uncurl from datalad-next.
So this seems to be the regular git-annex behavior, the remote claims the URL when it is added / registered. E.g.:
❱ git annex addurl --fast --file cat.jpg "https://unsplash.com/photos/a7bdqjeG6M4/download?force=true&w=640"
addurl https://unsplash.com/photos/a7bdqjeG6M4/download?force=true&w=640 (to cat.jpg) ok
❱ git annex initremote uncurl type=external externaltype=uncurl encryption=none
initremote uncurl ok
❱ git annex addurl --fast --file bat.jpg "https://unsplash.com/photos/8vO-HsnSq4E/download?force=true&w=640"
addurl https://unsplash.com/photos/8vO-HsnSq4E/download?force=true&w=640 (from uncurl) (to bat.jpg) ok
❱ git annex whereis
whereis bat.jpg (1 copy)
13f8e4f8-648f-48c2-bfd8-bc1c836a855c -- [uncurl]
uncurl: https://unsplash.com/photos/8vO-HsnSq4E/download?force=true&w=640
ok
whereis cat.jpg (1 copy)
00000000-0000-0000-0000-000000000001 -- web
web: https://unsplash.com/photos/a7bdqjeG6M4/download?force=true&w=640
ok
Which means this was my error (I did not enable the remote in time). And it probably can be repaired with git annex rmurl
followed by git annex registerurl
(I would also expect git annex unregisterurl
to also work, but it didn't do what I expected). But probably, given datalad make
's reliance on the datalad-remake special remote, we could protect the command againist unattentive users such as me.
Thanks a lot @mslw for the investigation. Will close this now.
So far so good
When I run the example from the README, everything works fine:
The file is associated with the datalad-remake remote:
and I can get it without issue:
Here's where things can go wrong
However, when I swap the order of
git annex initremote
andmake --prospective-execution
(running the latter first):The file remains associated with the web remote:
Even though the remake remote is available:
Consequently,
get
fails. Note that the error is aboutannex.security.allowed-url-schemes
(not unverified downloads, and not remake-trust-related), which I think suggests that the datalad-remake address is being handled by the web remote.note: what I really meant by writing "things can go wrong" in the heading, I meant "this is how I messed up on my first attempt"
Looking back
I wonder if this is an expected behaviour? I thought the order should not matter and git-annex would "reassign" the special remote which claims the URL after remake gets enabled. So to me it looks like:
make
command should check if a remake remote is availableMight also be worth comparing to e.g. uncurl from datalad-next.