Please describe the problem.
Calling git annex checkpresentkey <key> <remote>
for a https git remote with authentication immediately removes credentials stored with git for said remote.
What steps will reproduce the problem?
See transcript below.
What version of git-annex are you using? On what operating system?
git-annex version: 10.20240430
build flags: Assistant Webapp Pairing Inotify DBus DesktopNotify TorrentParser MagicMime Feeds Testsuite S3 WebDAV
dependency versions: aws-0.24.1 bloomfilter-2.0.1.2 crypton-0.34 DAV-1.3.4 feed-1.3.2.1 ghc-9.6.5 http-client-0.7.17 persistent-sqlite-2.13.3.0 torrent-10000.1.3 uuid-1.3.15 yesod-1.6.2.1
key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 BLAKE2B256E BLAKE2B256 BLAKE2B512E BLAKE2B512 BLAKE2B160E BLAKE2B160 BLAKE2B224E BLAKE2B224 BLAKE2B384E BLAKE2B384 BLAKE2BP512E BLAKE2BP512 BLAKE2S256E BLAKE2S256 BLAKE2S160E BLAKE2S160 BLAKE2S224E BLAKE2S224 BLAKE2SP256E BLAKE2SP256 BLAKE2SP224E BLAKE2SP224 SHA1E SHA1 MD5E MD5 WORM URL VURL X*
remote types: git gcrypt p2p S3 bup directory rsync web bittorrent webdav adb tahoe glacier ddar git-lfs httpalso borg rclone hook external
operating system: linux x86_64
supported repository versions: 8 9 10
upgrade supported from repository versions: 0 1 2 3 4 5 6 7 8 9 10
local repository version: 10
on Ubuntu 22.04 installed via nixpkgs.
Please provide any additional information below.
With git credential configured to store them in ~/creds:
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
$ cat ~/creds
cat: /home/icg149/creds: No such file or directory
$ git push
Username for 'http://localhost:3000': forgejo
Password for 'http://forgejo@localhost:3000':
Everything up-to-date
$ cat ~/creds
http://forgejo:forgejoforgejo@localhost%3a3000
$ git annex --debug checkpresentkey MD5E-s22--9fd0423717d1802f35d83d0663fa6074 origin
[2024-06-26 12:06:09.806467] (Utility.Process) process [785421] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","show-ref","git-annex"]
[2024-06-26 12:06:09.811952162] (Utility.Process) process [785421] done ExitSuccess
[2024-06-26 12:06:09.813689288] (Utility.Process) process [785422] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","show-ref","--hash","refs/heads/git-annex"]
[2024-06-26 12:06:09.820064447] (Utility.Process) process [785422] done ExitSuccess
[2024-06-26 12:06:09.821678763] (Utility.Process) process [785423] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","cat-file","--batch"]
[2024-06-26 12:06:09.846601841] (Utility.Url) Request {
host = "localhost"
port = 3000
secure = False
requestHeaders = [("Accept-Encoding",""),("User-Agent","git-annex/10.20240430")]
path = "/forgejo/test1234.git/annex/objects/b9f/209/MD5E-s22--9fd0423717d1802f35d83d0663fa6074/MD5E-s22--9fd0423717d1802f35d83d0663fa6074"
queryString = ""
method = "HEAD"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
proxySecureMode = ProxySecureWithConnect
}
[2024-06-26 12:06:09.849624508] (Utility.Process) process [785424] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","credential","fill"]
[2024-06-26 12:06:09.875935065] (Utility.Process) process [785424] done ExitSuccess
[2024-06-26 12:06:09.876187369] (Utility.Url) Request {
host = "localhost"
port = 3000
secure = False
requestHeaders = [("Accept-Encoding",""),("Authorization","<REDACTED>"),("User-Agent","git-annex/10.20240430")]
path = "/forgejo/test1234.git/annex/objects/b9f/209/MD5E-s22--9fd0423717d1802f35d83d0663fa6074/MD5E-s22--9fd0423717d1802f35d83d0663fa6074"
queryString = ""
method = "HEAD"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
proxySecureMode = ProxySecureWithConnect
}
[2024-06-26 12:06:10.002427959] (Utility.Process) process [785431] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","credential","reject"]
[2024-06-26 12:06:10.04428136] (Utility.Process) process [785431] done ExitSuccess
[2024-06-26 12:06:10.044677033] (Utility.Url) Request {
host = "localhost"
port = 3000
secure = False
requestHeaders = [("Accept-Encoding",""),("User-Agent","git-annex/10.20240430")]
path = "/forgejo/test1234.git/annex/objects/zK/2F/MD5E-s22--9fd0423717d1802f35d83d0663fa6074/MD5E-s22--9fd0423717d1802f35d83d0663fa6074"
queryString = ""
method = "HEAD"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
proxySecureMode = ProxySecureWithConnect
}
[2024-06-26 12:06:10.046640629] (Utility.Process) process [785439] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","-c","annex.debug=true","credential","fill"]
Username for 'http://localhost:3000': ^C
$ cat ~/creds
$
# End of transcript or log.
This seems to depend on if the remote has the key or not. If it doesn't have it the above happens, if it does have it this happens:
Does git-annex interpret the 404 in the case of the key not being on the remote as an authentication failure and then rejects the credentials? I think that should only happen on a 401...