Debuging failed authentication when an observed git repo is updated

I set a Credential in Diffusion > R > Manage > URIs > uri, but it does not seem be used. I added to the environment export GIT_SSH_COMMAND="ssh -vvv" to get more details about what ssh does, and in the stderr reported in Diffusion > R > Manage > Status there is:

debug1: Next authentication method: publickey
debug1: Trying private key: /usr/sbin/.ssh/id_rsa
debug3: no such identity: /usr/sbin/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /usr/sbin/.ssh/id_dsa
debug3: no such identity: /usr/sbin/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /usr/sbin/.ssh/id_ecdsa
debug3: no such identity: /usr/sbin/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /usr/sbin/.ssh/id_ed25519
debug3: no such identity: /usr/sbin/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method

How exactly is the Credential I set for the repo URL made available to the git command / ssh used to update the repo?

Passing GIT_SSH_COMMAND probably breaks it: the credential is passed by using a custom GIT_SSH_COMMAND which loads the credential (specified by envvar). See https://secure.phabricator.com/source/phabricator/browse/master/src/applications/diffusion/protocol/DiffusionGitCommandEngine.php;3a50ea4f473cb250d3a66d53a67585de1b3a99f7$29 and https://secure.phabricator.com/source/phabricator/browse/master/src/applications/diffusion/protocol/DiffusionCommandEngine.php$293

It’s using scripts/ssh/ssh-connect.php, so you can try debugging there.

Thanks for the pointers. Turned out the repo URLs contained an old username, long story.