How to replicate:
1. Create freestyle job
2. Add git scm with SSH url and select ssh key for it
3. Enable SSH Agent in Build Environment section and select different key for it
Cloning the remote Git repository
Cloning repository ssh: > git init /opt/jenkins/workspace/ansible/cm-ansible-potiomkin-sync-34 # timeout=10
Fetching upstream changes from ssh: > git --version # timeout=10
using GIT_SSH to set credentials jenkins at stash ssh
> git fetch --tags --progress ssh:ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh: returned status code 128:
stderr: Repository not found
The requested repository does not exist, or you do not have permission to access it.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
Disabling SSH Agent fixes the problem.
Adding two keys to ssh agent doesn't work as expected for me. It looks like only first ssh key is used/visible.