Mirroring via SSH does not work

Zendesk: https://gitlab.zendesk.com/agent/tickets/81620

Since the SSH mirror feature was introduced we've seen a handful of customers report that it doesn't work. I'm not 100% sure if it fails in all cases, but I was able to reproduce it.

After generating an SSH key on my test project, I copied the public key to a project on GitLab.com. After saving and updating the mirror, I get the following error:

Mirror update for root/gitlab-ce2 failed with the following message: Failed to add the ECDSA host key for IP address '52.167.219.168' to the list of known hosts (/tmp/gitlab-shell-known-hosts2).
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I used the Rails console to extract the SSH private and public key from this project's import data and tried to clone and SSH manually. I am able to clone and SSH manually with no issues.

cc/ @nick.thomas

Assignee Loading
Time tracking Loading