Deploy key added but It does not have perms allowed into repository

Hello, I’m going to explain all steps that made it.

  1. Create a project
  2. Add Deploy Key (SSH id_rsa.pub) in the main server
  3. Try to clone:
[example@foo]$ git clone git@gitlabce.foo.com:project.git
Cloning into 'project'...
remote:
remote: ========================================================================
remote:
remote: The project you were looking for could not be found or you don't have permission to view it.
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  1. Test SSH connection to:
ssh -T -v git@gitlabce.foo.com
Welcome to GitLab, Anonymous!
  1. Check-in /var/opt/gitlab/.ssh/authorized_keys if SSH is correct. Yes, It’s showed inside of this file.

  2. What Am I wrong? Why cannot clone the repository?

I realise that this answer is very late, but perhaps someone else will be looking for a solution.

I run into the same situation today. Used deploy keys before with no issue, but could not do it now. Key added in all the right places, enabled, etc. But - thanks to the topic owner - I looked at
/var/opt/gitlab/.ssh/authorized_keys file.
My key was there, but more than once, and also there were several lines containing just hash signs (and nothing else). I tried several steps, one by one, saving the file after each one and retrying the fetch. What helped at the end was making sure that there is only one entry of the key, and hash lines are removed. I don’t know the reason, and why it has worked, but I deemed this is not dangerous, since authorized keys file can be backed up and restored if needed.