What is the background/status on https://confluence.atlassian.com/bitbucketserverkb/git-ssh-clone-fails-with-error-permission-denied-publickey-in-bitbucket-server-1142229264.html? This appears to be a new issue in the last 7.x versions. I am seeing it on a 7.22.2 instance but not on a 7.17.0 instance. The former refuses to authenticate valid keys coming from an ssh-agent.
BTW, the fix of unsetting the env works.