datalad / datalad-ukbiobank

Resources for working with UKBiobank as a DataLad dataset
MIT License
6 stars 12 forks source link

`ukb-update` broken with `git-annex >= 10.20220526` #89

Closed mih closed 1 year ago

mih commented 2 years ago

Tested to be broken with 10.20220526-gc6b112108 (linux) and 10.20220624 (brew) -- last known-to-work version is 10.20220504.

Revealed by https://github.com/datalad/datalad-ukbiobank/pull/87

The path to the situation that shows the issue is a bit complicated, and I failed to find a minimal reproducer. However, within the failing test, this is the situation:

% git annex add -- ses-2/func/sub-12345_ses-2_task-hariri_sbref.json                                                                   
add ses-2/func/sub-12345_ses-2_task-hariri_sbref.json 
git-annex: ses-2/func/sub-12345_ses-2_task-hariri_sbref.json: rename: does not exist (No such file or directory)
failed
add: 1 failed
% git status --untracked=all 
On branch incoming-bids
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        ses-2/func/sub-12345_ses-2_task-hariri_sbref.json

nothing added to commit but untracked files present (use "git add" to track)

% ls -l ses-2/func/sub-12345_ses-2_task-hariri_sbref.json
lrwxrwxrwx 1 mih mih 126 Jul 22 15:01 ses-2/func/sub-12345_ses-2_task-hariri_sbref.json -> ../../.git/annex/objects/Gq/5F/MD5E-s16--7717b383a501e2b750b7147032ec5bc9.json/MD5E-s16--7717b383a501e2b750b7147032ec5bc9.json

Essentially, the untracked file is a moved/renamed annex-symlink. It was "imported" from another branch via git read-tree -u --reset <otherbranch>, and unstaged via git reset HEAD ., then renamed. The following annex add call shown above fails.

The full debug log, does not reveal anything interesting in addition:

% git annex --debug add -- ses-2/func/sub-12345_ses-2_task-hariri_sbref.json\ 

[2022-07-22 16:08:08.700985299] (Utility.Process) process [447621] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","show-ref","git-annex"]
[2022-07-22 16:08:08.703691231] (Utility.Process) process [447621] done ExitSuccess
[2022-07-22 16:08:08.703925333] (Utility.Process) process [447622] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","show-ref","--hash","refs/heads/git-annex"]
[2022-07-22 16:08:08.706469813] (Utility.Process) process [447622] done ExitSuccess
[2022-07-22 16:08:08.706802798] (Utility.Process) process [447623] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","log","refs/heads/git-annex..e0e504a6b64f4377e530ed9cf997339f05ee5a4b","--pretty=%H","-n1"]
[2022-07-22 16:08:08.70958952] (Utility.Process) process [447623] done ExitSuccess
[2022-07-22 16:08:08.710889571] (Utility.Process) process [447624] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","cat-file","--batch"]
[2022-07-22 16:08:08.713634081] (Utility.Process) process [447625] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","symbolic-ref","-q","HEAD"]
[2022-07-22 16:08:08.716216812] (Utility.Process) process [447625] done ExitSuccess
[2022-07-22 16:08:08.716413387] (Utility.Process) process [447626] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","show-ref","refs/heads/incoming-bids"]
[2022-07-22 16:08:08.718956163] (Utility.Process) process [447626] done ExitSuccess
[2022-07-22 16:08:08.71915702] (Utility.Process) process [447627] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","ls-files","-z","--others","--exclude-standard","--","ses-2/func/sub-12345_ses-2_task-hariri_sbref.json"]
[2022-07-22 16:08:08.721819403] (Utility.Process) process [447628] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","check-attr","-z","--stdin","annex.backend","annex.largefiles","annex.numcopies","annex.mincopies","--"]
add ses-2/func/sub-12345_ses-2_task-hariri_sbref.json 
git-annex: ses-2/func/sub-12345_ses-2_task-hariri_sbref.json: rename: does not exist (No such file or directory)
failed
[2022-07-22 16:08:08.725364409] (Utility.Process) process [447627] done ExitSuccess
[2022-07-22 16:08:08.725505447] (Utility.Process) process [447629] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","ls-files","-z","--modified","--","ses-2/func/sub-12345_ses-2_task-hariri_sbref.json"]
[2022-07-22 16:08:08.728228073] (Utility.Process) process [447629] done ExitSuccess
[2022-07-22 16:08:08.728438983] (Utility.Process) process [447630] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","diff","--name-only","--diff-filter=T","-z","--cached","--","ses-2/func/sub-12345_ses-2_task-hariri_sbref.json"]
[2022-07-22 16:08:08.731222872] (Utility.Process) process [447630] done ExitSuccess
[2022-07-22 16:08:08.731581192] (Utility.Process) process [447624] done ExitSuccess
[2022-07-22 16:08:08.731805783] (Utility.Process) process [447628] done ExitSuccess
add: 1 failed
mih commented 2 years ago

This is possibly related to

git-annex (10.20220724) UNRELEASED; urgency=medium

  * add: Fix reversion when adding an annex link that has been moved to
    another directory. (Introduced in version 10.20220624)

So maybe a fix is coming.

yarikoptic commented 2 years ago

please unpin and check if works? that release has come