I've been using git-annex in android/termux (pixel 3a, android 12 rooted) for a while to manage multiple repositories in command line (no assistant here). So far so good. I upgraded termux packages one day and troubles began: all repositories now throw the following errors for all kind of git-annex commands:
$ git annex status
git-annex: This repository is not initialized for use by git-annex, but .git/annex/objects/ exists, which indicates this repository was used by git-annex before, and may have lost its annex.uuid and annex.version configs. Either set back missing configs, or run git-annex init to initialize with a new uuid.
error: external filter 'git-annex smudge --clean -- %f' failed 1
error: external filter 'git-annex smudge --clean -- %f' failed
Note I filter out the recurring error "WARNING: linker: Warning: failed to find generated linker configuration from ..." for clarity. git version: 2.36.1 git annex version: 10.20220121
Funny thing #1: "git config -l" shows the uuid is correctly set.
Funny thing #2: I installed nix-on-droid with git (2.33.3) and git-annex (8.20211028) and ... I have the same error (?!?).
Funny thing #3: when I clone a repository from scratch, "git annex init" never completes. When interrupted, then "git annex status" never completes...
Funny thing #4: git alone works very well, in both git-annex'ed repos or plain git ones.
If you have any idea of something to check/change/update/try, I'll be happy to report the results.
Upgrade your git-annex to a newer version. I suspect you will get a different error message, perhaps along the lines of:
(Although that would not explain why git-annex init might hang.)
I'm using the latest git-annex version available for arm64 on android already. I checked both the stable build and the autobuild, both point to the same archive with git-annex 10.20220121-g0bcb94487
I upgraded git to the latest revision available in termux base packages, namely git 2.37.1. It did not change anything.
For those who face the same issue, here is a workaround: in git config, I force the annex.uuid and annex.version of the smudge & clean filter commands.
in .git/config, from this:
I go to:
You can get the repo uuid in the same file.
This is it !
I don't know though why the git-annex filter command is not able to read the .git/config file to retrieve this information by itself (?!).
Aha, that is a useful clue about what's going on here!
Since those smudge commands are run by git, it may be that git is doing something to the environment or cwd that prevents git-annex from reading the git config.
Also, you have git installed in termux, but git-annex includes its own copy of git in its distribution. So it may be that the termux git is somehow causing this problem, but the one included in git-annex does not.
Can you try running:
And then see if the problem occurs when you use git-annex from within the shell that starts?